Open - Automation

The Open method is superseded by Open2. Please consider using the more recent version. Open has been retained for backward compatibility.

The Open method opens an existing document. Returns an object.

The Open2 command should specifically be used instead of Open when the worksheet being loaded is an Excel file where the sheet name needs to be specified. It can also be used to specify any data import options when loading a data file.

Syntax

object.Open( FileName, Options )

Parameter

Type

Required/

Optional

Default

Description

FileName

String

Required

This provides the path and file name of the file.

Options

String

Optional

""

See the Worksheet FilterID page for links to the import options available for opening specific data file formats.

Remarks

1. The Options parameter consists of a series of semicolon-separated keywords. See Worksheet FilterID for details on the Options.

2. For example, Options contains a keyword "Sheet" for opening Excel files. Use this keyword to specify a worksheet in an Excel workbook.

SurferApp.Documents.Open("d:\data\multisheet.xls", Options:="Sheet=Sheet3")

Example 1

This example demonstrates how to open a document.

Dim Plot As Object

Set Plot = Docs.Open(FileName:=SurferApp.Path+"\Samples\Sample1.srf")

Example 2

This script displays all the methods and properties in the Documents collection.

Used by: Documents collection