全局变量如果要在后台调度里使用的,不能直接用的,要使用的话,参考下面的脚本:
Dim WrkSpcApp As Object
Set WrkSpcApp = GetObject("", "Workspace.Application")
‘ Get a pointer to the Variable object called Variable1 in the User globals
Dim TargetVar As Object
Set TargetVar = WrkSpcApp.Documents("User").Page.FindObject("Variable1")
‘ Set the current value in the variable object to a 1
TargetVar.CurrentValue = 1