Open Workbook File

Opens a hidden Excel workbook (.XLS/.XLSX) for editing.

 

Input Arguments

 

0

File Path or Embedded File

Workbook File Path

The path to the Excel workbook file to open.

1

Boolean

Verify File Exists?

True will check if the file exists, if not a new file will be created.

 

Return Arguments

 

2

Integer

Workbook Handle

A handle to the opened workbook.

 

Returned Status

 

SUCCESS

The workbook was opened successfully.

FAILURE

The workbook was not found, or Microsoft Excel is not installed on the system.

Remarks

The workbook handle returned by this command (argument 1) should be referenced by other commands that use this workbook. Ensure that you close the workbook when finished working with it. Otherwise, a hidden instance of Microsoft Excel will continue executing in the background. (It can be terminated using the Windows Task Manager).

When opened, the workbook is stored in the active SA file. Executing a “New SA File” MP command after open ing a workbook will cause changes to be lost and the reference to the workbook to become invalid.

Step Status Test can be used on the Open Workbook File step if the Verify File Exists? argument is TRUE. If FALSE, the command always succeeds. In either case the workbook will be opened. The difference is whether you are explicitly requiring a prior instance of the file to exist prior to opening it or if you are content to start a new workbook.

Embedded files can be worked with directly using the Existing Embedded File method or an embedded file can be referenced using the convention “<collection>::<File>” . When the file name is parsed (either direct entry or provided by reference), it will always parse the name and attempt to find the embedded file in the tree. If it is successful, then it will use the embedded file for specified operation – otherwise it will transition to a disk-based file.