Encapsulates the AutoMate action in the 天ariables group, 鉄et variable. The method sets a previously created AutoMate variable to the value specified.
Declaration
function SetVar (varVarName As Variant,
varNewValue As Variant) As Integer
Parameters
varVarName
The name of the AutoMate variable whose value to change.
varNewValue
The new value of the variable.
Description
Use the SetVar method to explicitly set the value of a variable created within AutoMate using the Create Variable step.
When the script starts, AutoMate will automatically allocate the variables from your task into the script using the same names from the task. For example, if before the SCRIPT: step in your task you have created a variable called MYVAR, the variable MYVAR will be accessible in your script like any other regular variable. You can safely modify and work with this variable like another other VBA object. When the script ends, AutoMate will automatically write any changes you made to the variable back to the task.
If, however, you need to create a NEW variable to be passed back to AutoMate when the script is finished, you will need to create the variable before entering the script by using a Create Variable action. This is because AutoMate can only track those variables that were created before the script started.