TSTool / Command / ReadExcelWorkbook
ReadExcelWorkbook command reads a Microsoft Excel workbook file (
The workbook is retained in memory and can be manipulated using commands that write to Excel, for example:
- Create an Excel workbook template with desired analysis, formatting, charts, etc. Leave placeholders for data sheets. Refer to the data sheets using named ranges.
- Read the Excel workbook template using the
- Manipulate the Excel workbook using TSTool commands that write to Excel, for example
WriteTableToExcel. If the
KeepOpen=Falseparameter is used, the original file will not be re-written. Therefore, use
KeepOpen=Truein combination with the following.
- Use the
CloseExcelWorkbookcommand and specify
WriteFile=Trueto force writing the Excel workbook. The
NewOutputFileparameter can also be specified to write a new output file, leaving the original Excel file intact.
TSTool uses the Apache POI software to read and manipulate Excel workbooks and consequently functionality is constrained by the features of that software package.
The following dialog is used to edit the command and illustrates the syntax of the command.
ReadExcelWorkbook Command Editor (see also the full-size image)
The command syntax is as follows:
|The name of the Excel workbook file (
||None – must be specified.|
See the automated tests.