Opens a Microsoft Excel workbook and establishes a session name for use in subsequent Excel actions. Used to open an existing Microsoft Excel document and create an associated session for manipulating it.
Declaration
<AMEXCELOPENWORKBOOK WORKBOOK="text" VISIBLE="YES/NO" />
Example
This example opens an existing spreadsheet, retrieves the data contained in the first 3 rows of column A and populates a dataset with the results. The data is then looped through. A message box is contained inside the loop to display the value of the current row. In order for this task to work, make sure to edit the properties of the 'Open Workbook' action (step 1) to point to a valid Excel file that contains data in the first 3 rows and columns.
<AMEXCELOPENWORKBOOK WORKBOOK="C:\Temp\myexceldocument.xlsx" />
<AMEXCELCELLSTODATASET RESULTDATASET="mydataset" STARTCELLROW="1" STARTCELLCOLUMN="1" ENDCELLROW="3" ENDCELLCOLUMN="1" />
<AMLOOP TYPE="DATASET" DATASET="mydataset">
<AMSHOWDIALOG>The value of row %mydataset.CurrentRow%, column A is %mydataset.A%.
</AMSHOWDIALOG>
</AMLOOP>
<AMEXCELCLOSEWORKBOOK SAVE="NO" />
See Also: Create Workbook, Close Workbook, Add Worksheet, Activate Worksheet, Get Cell, Set Cell, Cells to Dataset, Dataset to Cells, About Datasets
|
AWE's Excel actions use Microsoft's Excel automation engine to perform their work. Therefore, Microsoft Excel must be licensed and installed on the system in order for these actions to work. Excel objects run in the context of the user executing them. If EFT is running as a Local System, then the Excel object is executed using the Local System profile. Before using an Excel action in Event Rules, refer to Globalscape Knowledgebase article #11089 for important information. This action is only useful in conjunction with other Excel actions. It is not possible to use AWE's Excel actions on a spreadsheet that was not opened by the Open Workbook action or created by the Create Workbook action. |
Property |
Type |
Required |
Default |
Markup |
Description |
Workbook |
Text |
Yes |
(Empty) |
WORKBOOK="c:\filename.xls" |
The path and file name of the Excel document that should be opened. |
Session Name |
Text |
Yes |
ExcelSess1 |
SESSION="ExcelSess7" |
The session name to be created. The session name is used to identify which document subsequent Excel actions should be linked to. Numerous sessions can exist within a single task allowing several Excel documents to be open simultaneously. If working with only one document, this can remain at the default session name, which is Excelsess1. |
Workbook is Invisible |
Yes/No |
No |
No |
VISIBLE="NO" |
If enabled, specifies that the Microsoft Excel Window will not be displayed during execution (processing will occur in the background). Usually, this option should be left unchecked during task construction to allow for easy debugging. Once the task is working properly and ready for production, this option can be enabled. |