Desktop productivity for business analysts and programmers

EG 4.1 OLE Reference

Reply
N/A
Posts: 0

EG 4.1 OLE Reference

Does anyone know when the OLE reference is to be released for EG 4.1.
I can find the VBscripting.dll within the EG4 program directory but I cannot add this as a reference to my VB project.
Community Manager
Posts: 2,691

Re: EG 4.1 OLE Reference

Lee,

Here is a preliminary version of the API reference:

http://support.sas.com/documentation/onlinedoc/guide/SASEGScripting41.zip

It's a Microsoft HTML Help file (CHM) within a ZIP archive.

This gives you the full reference documentation, but might not be enough to get you started. If you post back with a question about what you are trying to do via automation, I'd be happy to try and provide an example.

Chris
N/A
Posts: 0

Re: EG 4.1 OLE Reference

Thanks, this may be useful to us later on, however the main issue we're having is referencing the EG4.1 scripting DLL (SASEGScripting.dll).

We're just trying to access EG using VBA, however the DLL does not appear to be registered with windows. When we attempt to add the file (from any VBA application go to tools -> references -> browse) it states "Can't add reference to specified file.".

Any idea what's wrong?

Cheers.
Community Manager
Posts: 2,691

Re: EG 4.1 OLE Reference

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 /tlbSmiley FrustratedASEGScripting.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
N/A
Posts: 0

Re: EG 4.1 OLE Reference

Chris,
Thanks for the quick response. This is exactly what I needed. I've now registered the Files and can now reference the SASEGScripting dll.
N/A
Posts: 0

Re: EG 4.1 OLE Reference

Chris,
Although I can now reference the scripting DLL when I run the following code

Dim objApplication
Set objApplication = CreateObject("SASEGscripting.Application")
I get an error :-
Run-time erro '429' Activex componet can't create object.

Do you have any ideas why this may not be working?

Lee
N/A
Posts: 0

Re: EG 4.1 OLE Reference

Sorrry, the code was actually

Set objApplication = CreateObject("SASEGObjectModel.Application")
Community Manager
Posts: 2,691

Re: EG 4.1 OLE Reference

Lee,

For EG 4.1 you want to use this prog ID:

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

You can get a quick example by going to Tools->Schedule Project. This will bring up the Windows scheduler dialog, which you can cancel. Then you'll have a VBScript file referenced in your project that performs a simple automation task of running the project.

Chris
N/A
Posts: 1

Re: EG 4.1 OLE Reference

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.

Community Manager
Posts: 2,691

Re: EG 4.1 OLE Reference

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:

http://www.sascommunity.org/wiki/Not_Just_for_Scheduling:_Doing_More_with_SAS_Enterprise_Guide_Autom...

Chris

Frequent Contributor
Posts: 100

Re: EG 4.1 OLE Reference

What does the "frustrated smilely" in Chris Hemedinger's post represent?  It looks like some text got translated into a "frustrated smilely", but I don't know what that text is.  Does anyone know what text is translated into a "frustrated smilely"?

 

Thanks,

 

Jim

 

P.S.  I've tried the below, but no luck.

:~

Smiley Happy

:=P

=P

:-P

X[ 

><

B/

>.<*

-_-*

:-P

Smiley Tongue

><

://

:-/

>-<

>_<

>.<

-_-

*:*(

*:*

Frequent Contributor
Posts: 100

Re: EG 4.1 OLE Reference

Never mind, I found it.  It's : S but without a space in between:  Smiley Frustrated  

 

Thus a : S without a space inbetween should be substituted in the below command that Chris Hemedinger listed:
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\RegAsm.exe /tlbSmiley FrustratedASEGScripting.tlb /codebase "c:\Program Files\SAS\Enterprise Guide 4\SASEGScripting.dll"

 

Here's a version with a space between the : and the S
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\RegAsm.exe /tlb: SASEGScripting.tlb /codebase "c:\Program Files\SAS\Enterprise Guide 4\SASEGScripting.dll"

 

Regards,

 

Jim

Ask a Question
Discussion stats
  • 11 replies
  • 939 views
  • 0 likes
  • 4 in conversation