BookmarkSubscribeRSS Feed
kgkeitot
Calcite | Level 5

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

2 REPLIES 2
cau83
Pyrite | Level 9

What operating system?

When you say you run the VB Script, how do you go about doing it and what program is running it?

ChrisHemedinger
Community Manager

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

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

sas-innovate-2024.png

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.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2368 views
  • 0 likes
  • 3 in conversation