TSTool / Command / CloseExcelWorkbook
CloseExcelWorkbook command closes a Microsoft Excel workbook
that has been opened with a previous command and kept open,
for example by using the
KeepOpen=True command parameter.
The act of “closing” discards the workbook from program memory and optionally
causes the workbook to be written to an Excel file.
Using this command is helpful when multiple commands are manipulating an Excel workbook,
for example when used in a
For loop block.
The following dialog is used to edit the command and illustrates the syntax of the command.
CloseExcelWorkbook Command Editor (see also the full-size image)
The command syntax is as follows:
|The name of the currently open Excel workbook (
*.xlsx) to close, as an absolute path or relative to the command file location. The filename will match that of previous commands that have read an existing or created a new Excel file. No action is performed if the open workbook is not found. Can be specified using processor
|None – must be specified.
|Specify if a new output file should be written. This is useful if
OutputFile corresponds to an Excel file that was read but is not intended to be written over.
|Indicate whether the output file should be written (
True) or not (
False). The parameter can be used to override the default behavior.
False if the workbook was originally opened for reading,
True if the workbook was originally created or opened for writing.
|The Excel file when written can be configured to cause Excel to recalculate formulas when it opens. This is the default when writing to ensure that the Excel workbook contents are up to date when opened. This parameter can be used to override the default.
See the automated tests.