How does one troubleshoot problems evident by the object not being able to open a file? Option Explicit
Dim Application
Dim Project
' Change if running a different version of EG
Dim egVersion
egVersion = "SASEGObjectModel.Application.7.1"
If WScript.Arguments.Count = 0 Then
WScript.Echo "ERROR: Expecting the full path name of a project file"
WScript.Quit -1
End If
' Create a new SAS Enterprise Guide automation session
On Error Resume Next
Set Application = WScript.CreateObject(egVersion)
' WScript.Echo "Opening project: " & WScript.Arguments.Item(0)
If Err.Number <> 0 Then
WScript.Echo "ERROR: Need help with 'Set Application = WScript.CreateObject(egVersion)'"
WScript.Quit -1
End If
' Open the EGP file with the Application
Set Project = Application.Open(WScript.Arguments.Item(0),"")
If Err.Number <> 0 Then
WScript.Echo "ERROR: Unable to open " _
& WScript.Arguments.Item(0) & " as a project file"
WScript.Quit -1
End If Output: C:\Users\Dreamy\Desktop\ExtractCode>cscript ExtractCode_v7.vbs C:\Users\Dreamy\Desktop\ExtractCode\Qtr_ZZZZ.egp
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.
ERROR: Unable to open C:\Users\Dreamy\Desktop\ExtractCode\Qtr_ZZZZ.egp as a project file What am I missing?: 0. I'm using SAS Enterprise Guide 7.1 (64-bit), B4N008 hotfixed, recently upgraded the install from 32-bit. I just upgraded Windows 10, and this OS is 64-bit . 1. If I use the other 32 bit version of CSCRIPT then the script fails at create object. I'm pretty sure I'm using the correct 64-bit CSCRIPT executable. 2. When I try to run these two lines of code in VBscript : Set Application = WScript.CreateObject("SASEGObjectModel.Application.7.1")
WScript.Echo Application.Name & ", Version: " & Application.Version I get: Enterprise Guide, Version 7.100.5.0 3. I ran this for the sake of doing everything: c:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm /codebase "c:\Program Files\SASHome\SASEnterpriseGuide\7.1\sasegscripting.dll" I received the output: Microsoft .NET Framework Assembly Registration Utility version 4.0.30319.18408
for Microsoft .NET Framework version 4.0.30319.18408
Copyright (C) Microsoft Corporation. All rights reserved.
Types registered successfully 4. The EGP file that I am opening, is not opened by another instance of SAS EG, although I have another copy open in the GUI. 5. Other EGP files that I once was able to open, prior to the upgrade to WinTen and EG 64-bit, do not open either. If its easy -- give me hints and make me work for the solution. thanks
... View more