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

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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