Desktop productivity for business analysts and programmers

schedule task in sas eg

Accepted Solution Solved
Reply
New Contributor Cyn
New Contributor
Posts: 2
Accepted Solution

schedule task in sas eg

Im using SAS Enterprise Guide 4.1

When I try to run these two lines of code in VBScript:

Set Application = WScript.CreateObject("SASEGObjectModel.Application.4")
WScript.Echo Application.Name & ", Version: " & Application.Version

I receive the error below.

Error: could not locate automation class named "SASEGObjectModel.Application.4.1".
Code: 80020009
Source: WScript.Createobject

If I change to Set Application = CreateObject("SASEGObjectModel.Application.4"), I receive the error below:-

Error: ActiveX component can't create object: 'SASEGObjectModel.Application.4'

Code: 800A01AD

Source: Microsoft VBScript runtime error


I'm running on window 7 32 bit.

Appreciate the help.


Accepted Solutions
Solution
‎06-30-2015 04:45 PM
Community Manager
Posts: 2,697

Re: schedule task in sas eg

This might be an installation issue, where the SAS EG scripting model isn't registered.  Can you run this command (from a Windows command prompt) and try again?


C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\RegAsm.exe /codebase /tlb "C:\Program Files\SAS\Enterprise Guide 4\SASEGScripting.DLL"


You might need to change some of the paths to fit your system.


Then here is a test script:


Option Explicit

Dim App

On Error Resume Next

Set App = CreateObject("SASEGObjectModel.Application.4")

If (App Is Nothing) Then

   Dim strmsg

   Dim errNum

   If Err.Number <> 0 Then

       strmsg = "Error #" & Hex(Err.Number) & " " & Err.Description

                                 Wscript.Echo("Cannot create SASEGObjectModel.Application.4: " & strmsg)

                End If

End If

View solution in original post


All Replies
Solution
‎06-30-2015 04:45 PM
Community Manager
Posts: 2,697

Re: schedule task in sas eg

This might be an installation issue, where the SAS EG scripting model isn't registered.  Can you run this command (from a Windows command prompt) and try again?


C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\RegAsm.exe /codebase /tlb "C:\Program Files\SAS\Enterprise Guide 4\SASEGScripting.DLL"


You might need to change some of the paths to fit your system.


Then here is a test script:


Option Explicit

Dim App

On Error Resume Next

Set App = CreateObject("SASEGObjectModel.Application.4")

If (App Is Nothing) Then

   Dim strmsg

   Dim errNum

   If Err.Number <> 0 Then

       strmsg = "Error #" & Hex(Err.Number) & " " & Err.Description

                                 Wscript.Echo("Cannot create SASEGObjectModel.Application.4: " & strmsg)

                End If

End If

New Contributor Cyn
New Contributor
Posts: 2

Re: schedule task in sas eg

Thanks Chris, It works!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 710 views
  • 0 likes
  • 2 in conversation