OpenDocument Spreadsheet - Close workbook |
<AMODS ACTIVITY="close_workbook" SESSION="text" SAVETYPE="text (options)" DESTINATION="text" OVERWRITEDESTINATION="YES/NO" /> |
Description:
Closes a workbook previously opened or created by the Open/Create workbook activity and ends the associated session.
NOTE: Unlike Excel activities, the OpenDocument Spreadsheet activities do not rely on Microsoft's Excel engine to perform their work, therefore, Microsoft Excel does not need to be installed on the system in order to use these activities. Supported file types include Excel (*.xls, *.xlsx, *.xlsb, *.xlsm ), Open document spreadsheet (*.ods) and CSV (Comma Separated Value) files (*.csv). |
Mainly used to save and close a spreadsheet document that was modified with prior ODS steps and ends the associated session.
General
Property |
Type |
Required |
Default |
Markup |
Description |
Session Name |
Text |
Yes |
ExcelSess1 |
SESSION="ExcelSess7" |
The session name to identify which document should be closed from prior Excel steps. Numerous sessions can exist within a single task allowing several Excel documents to be open simultaneously. |
On completion |
Text (options) |
No |
Save |
|
Specifies what to do with the document upon completion of this activity. The available options are:
|
File |
Text |
Yes if On completion parameter is set to Save as |
(Empty) |
DESTINATION="c:\temp\dest.xls" |
The path and filename of the file in which changes will be saved. Click the folder icon to open a standard Explorer dialog in order to navigate to the desired file or simply enter the path and filename in the provided text box. |
Overwrite if workbook already exists |
Yes/No |
Yes if On completion parameter is set to Save as |
No |
OVERWRITE="YES" |
If set to YES, the newly created workbook will overwrite any workbook with the same name that exists in the destination. If set to NO (default), an existing workbook with the same name will not be overwritten, however, an error will occur during runtime as a result of matching filenames. This parameter is active only if the Get document by parameter is set to Create. |
NOTE: The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder. |
Description: This sample task opens a workbook, populates a dataset with data regarding the spreadsheets that it contains. The dataset is then looped. During each iteration, information about the current spreadsheet is displayed in a message dialog. The last step closes the workbook, ths ending the session.
<AMODS SESSION="OPENDOCSession1" WORKBOOK="C:\temp\Employees.xls" /> <AMODS ACTIVITY="list_worksheet" SESSION="OPENDOCSession1" RESULTDATASET="theSheets" /> <AMLOOP ACTIVITY="dataset" DATASET="theSheets"> <AMSHOWDIALOG WINDOWTITLE="Worksheet Information">Worksheet Name: %theSheets.WorksheetName% Worksheet Index: %theSheets.WorksheetIndex% Is worksheet visible?: %theSheets.IsVisible% Is worksheet active?: %theSheets.IsActive%</AMSHOWDIALOG> </AMLOOP> <AMODS ACTIVITY="close_workbook" SESSION="OPENDOCSession1" /> |