Activate Worksheet Action
<AMEXCELADDWORKSHEET SESSIONNAME="text" WORKSHEETNAME="text" LASTWORKSHEET="yes/no" TEMPLATENAME="text">
Activates a worksheet in a workbook from an established Excel session.
To activate an existing worksheet inside a Microsoft Excel document that was previously created or opened using AutoMate's Excel actions. This action is only useful in conjunction with the 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 changed from prior Excel steps. This allows several Excel files to be open simultaneously. If working with only one document, this value should not be changed from it's default value.
Specifies the name of the worksheet that should be activated. By default this is the text caption on the worksheet, however if BYINDEX=1 is specified then it can be a number (starting at 1).
When enabled, specifies that the WORKSHEET parameter is a number and not a text caption.
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.
<AMEXCELADDWORKSHEET WORKSHEETNAME="My New Sheet" LASTWORKSHEET="YES">
<AMEXCELACTIVATEWORKSHEET WORKSHEET="My New Sheet">
<AMEXCELSETCELL NEWVALUE="Set this data here" CELLROW="1" CELLCOLUMN="1">
<AMEXCELSETCELL NEWVALUE="and this here" CELLROW="2" CELLCOLUMN="1">