I tried to schedule a EG project. Nothing happened when the project was supposed to run. When I try to run the VBScript EG makes I get following text and nothing happens. Any idea what is the problem?
Error message:
Windows Script Host
Script: C:\PATHTOTHESCRIPT\EGScript5.vbs
Line: 7
Char: 1
Error: Object required
Code: 800A01A8
Source: Microsoft VBScript runtime error
My VBScript is this:
Option Explicit
Dim app
Call dowork
'shut down the app
If not (app Is Nothing) Then
app.Quit
Set app = Nothing
End If
Sub dowork()
On Error Resume Next
'----
' Start up Enterprise Guide using the project name
'----
Dim prjName
Dim prjObject
prjName = "C:\PATHTOTHEPROJECT\Customer_Flow_Framework.egp" 'Project Name
Set app = CreateObject("SASEGObjectModel.Application.4.3")
If Checkerror("CreateObject") = True Then
Exit Sub
End If
'-----
' open the project
'-----
Set prjObject = app.Open(prjName,"")
If Checkerror("app.Open") = True Then
Exit Sub
End If
'-----
' run the project
'-----
prjObject.run
If Checkerror("Project.run") = True Then
Exit Sub
End If
'-----
' Save the new project
'-----
prjObject.Save
If Checkerror("Project.Save") = True Then
Exit Sub
End If
'-----
' Close the project
'-----
prjObject.Close
If Checkerror("Project.Close") = True Then
Exit Sub
End If
End Sub
Function Checkerror(fnName)
Checkerror = False
Dim strmsg
Dim errNum
If Err.Number <> 0 Then
strmsg = "Error #" & Hex(Err.Number) & vbCrLf & "In Function " & fnName & vbCrLf & Err.Description
'MsgBox strmsg 'Uncomment this line if you want to be notified via MessageBox of Errors in the script.
Checkerror = True
End If
End Function
What operating system?
When you say you run the VB Script, how do you go about doing it and what program is running it?
You might try a simpler script to see if the mechanism is working. See:
Not Just for Scheduling: Doing More with SAS Enterprise Guide Automation - sasCommunity
For example, this simple script:
http://support.sas.com/documentation/onlinedoc/guide/examples/SASGF2012/NewApp.vbs.txt
Also, make sure that the script engine that's running is the 32-bit version of CSCRIPT.exe. These details are in the paper:
http://support.sas.com/documentation/onlinedoc/guide/examples/SASGF2012/Hemedinger_298-2012.pdf
Chris
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.