Lee,
Sounds like you would like to write code similar to the following:
Public Sub foo()
Dim objApp As SASEGScripting.Application
Dim objProject As SASEGScripting.Project
objApp = New SASEGScripting.Application
objProject = objApp.Open("myproject.egp", "")
objProject.Run
End Sub
This is an example of "early binding" code, which requires a reference to the EG scripting model exposed via COM. Most of our examples to date use VBScript and the "late binding" model, where you have a CreateObject("SASEGScripting.Application") call. Requires no COM reference, but the IDE doesn't help you with intellisense and such.
The SASEGScripting.dll is a .NET DLL, but it does expose a COM model. However, the type library required isn't registered by default. Here's how you can register it.
1. Open a command prompt window.
2. Run this command: (paths may vary depending on your installation)
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\RegAsm.exe /tlb:SASEGScripting.tlb /codebase "c:\Program Files\SAS\Enterprise Guide 4\SASEGScripting.dll"
Expected response:
Microsoft (R) .NET Framework Assembly Registration Utility 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Types registered successfully
Assembly exported to 'c:\Program Files\SAS\Enterprise Guide 4\SASEGScripting.tlb', and the type library was registered successfully
3. Run this command: (paths may vary depending on your installation)
"c:\Program Files\SAS\Shared Files\Integration Technologies\RegTypeLib.exe" "c:\Program Files\SAS\Enterprise Guide 4\SASEGScripting.tlb"
Expected response:
Registered c:\Program Files\SAS\Enterprise Guide 4\SASEGScripting.tlb
4. After these steps are completed, you should be able to Insert a reference to SAS Enterprise Guide 4.1 Object Library from your VBA application.
Chris
... View more