Get Active Worksheet
<AMEXCELGETACTIVEWORKSHEET SESSION="Text" WORKSHEETNAMEVARIABLE="Text" WORKSHEETINDEXVARIABLE="Text" />
Retrieves the name or index of the currently active worksheet in an established Excel session. The action populates either or both of two variables, one for the worksheet name and the other for the index.
Used to find the currently active worksheet in a Microsoft Excel document that was previously created or opened using one of AutoMate's Excel actions. This action is only useful in conjunction with other Excel actions found in AutoMate.
IMPORTANT: The Excel actions in AutoMate use the Microsoft Excel automation engine to perform their work. Because of this Microsoft Excel must be licensed and installed on the system to use the Excel Actions.
Specifies the session name to identify which document should be acted on. This allows several Excel files to be open simultaneously. If working with only one document, this value should not be changed from its default value.
Specifies the variable to populate with the worksheet name.
Specifies the variable to populate with the index number for the worksheet.
This action includes the Description tab for entering a custom step description.
More on setting custom step description
This action also includes the standard Error Causes and On Error failure handling options/tabs.
More on Error Handling Options
All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.
More on variables
More on expressions
More on the expression builder
NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.
<AMEXCELGETACTIVEWORKSHEET SESSION="ExcelSess1" WORKSHEETNAMEVARIABLE="VariableName1" WORKSHEETINDEXVARIABLE="VariableName2" />