Hello Chris,
Though the last post is years ago, the topic is still very helpful. I am working on the same task that control SAS EG project by SASEGScripting.Application, SASEGScripting.Project and other objects provided by SASEGScripting.dll.
Because I am using Excel VBA, I guess I need to register the COM dll and add it to reference before touching any real code. The question here is, I can not find below SASEGScripting.tbl file in my computer. I am using Win7 64bit and I could locate SASEGScripting.dll at C:\SAS94\SASEnterpriseGuide\7.1\.
Could you please help give some light on where to find and how to register the COM dll for EG 7.1?
Thanks,
Frank
Hi Frank,
The EGScripting.dll is installed and registered with Enterprise Guide, so you should not have to explicitly register it (or the tlb) if Enterprise Guide has already been installed on the machine. However, in addition to the other steps in this thread, if needed, you can also re-register the scripting dll by running "seguide.exe /register" (in the EG installation directory) from a command prompt (run as an administrator).
Casey
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
Hello Casey,
Appreciate the quick reply. Unfortunately, I am unable to execute "seguide.exe /register" as administrator at this moment.
May I have another question? Under current circumstance, will the reference from EGScripting.dll appear in VBA/Tools/Reference window and what is its displayed text? (I have never seen it before so I don't know what is the target look like). I looked through the reference window but did not see anything similar. Maybe I missed something but I think if EGScripting.dll is registered, it should appear there.
Thanks and have a good day,
Frank
Hi Frank,
Actually, "seguide.exe /register" does not appear to be properly exporting and registering the type library (embedded in the SASEGScripting.dll) as I expected. I confirmed it tries to (at least load/register), but was not working for me. I'll have to investigate that separately.
So, I had to follow the steps Chris posted to manually export and register, and they worked for me (on 32-bit EG 7.15)...
Here is the exact command I used (run in a Windows command prompt as an administrator) (you may have to update it with your EG installation and .NET Framework directory paths):
C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /tlb:"C:\Program Files (x86)\SASHome\x86\SASEnterpriseGuide\7.1\SASEGScripting.tlb" /codebase "C:\Program Files (x86)\SASHome\x86\SASEnterpriseGuide\7.1\SASEGScripting.dll"
And the output confirming proper export and registration...
C:\Windows\system32>C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /tlb:"C:\Program Files (x86)\SASHome\x86\SASEnterpriseGuide\7.1\SASEGScripting.tlb" /codebase "C:\Program Files (x86)\SASHome\x86\SASEnterpriseGuide\7.1\SASEGScripting.dll"
Microsoft .NET Framework Assembly Registration Utility version 4.7.2556.0
for Microsoft .NET Framework version 4.7.2556.0
Copyright (C) Microsoft Corporation. All rights reserved.Types registered successfully
Assembly exported to 'C:\Program Files (x86)\SASHome\x86\SASEnterpriseGuide\7.1\SASEGScripting.tlb', and the type library was registered successfully
Them run Chris' step #3 in the same command window. Here is the exact command I used:
"C:\Program Files\SASHome\x86\Integration Technologies\RegTypeLib.exe" "C:\Program Files (x86)\SASHome\x86\SASEnterpriseGuide\7.1\SASEGScripting.tlb"
Note: If you have 64-bit EG, use the 64-bit RegTypeLib.exe instead. For example:
"C:\Program Files\SASHome\Integration Technologies\RegTypeLib.exe" "C:\Program Files\SASHome\SASEnterpriseGuide\7.1\SASEGScripting.tlb"
Then, when I open VBA References in Excel, SASEGScripting appears and can be used...
Casey
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
Hello Casey,
Thanks for the light, it's beautiful. I noticed the usage of RegAsm.exe from .NET directory... Anyway, I have to find the administrator permission and .NET library for me first.
Thanks again,
Frank
Dear Chris,
I wanted to check out automation functionality of SAS EG 6.1 via VBA. As any attempts to create Application object led to an error, I've tried to register SASEGScripting.dll via regasm.exe and to create the tlb file following the 4 steps you've described. On the second step, however, I've got the following error: "RegAsm : error RA0000 : Type library exporter encountered an error while processing 'SAS.EG.Scripting.ISASEGContainerCollection, SASEGScripting'. Error: Type 'ISASEGContainerCollection' and type 'ISASEGOutputDatasets' both have the same UUID." After that VBA code started to work with late binding approach, but early binding still fails. Is there any way to resolve this RegAsm error?
Thanks in advance.
With EG 6.1, you should be able to run:
SEGuide.exe /register
And have the automation API become registered, if it isn't already.
And the scripting API and examples can be found in this sasCommunity.org article:
Chris
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.