BookmarkSubscribeRSS Feed
Josh
Calcite | Level 5

I'm looking at using Access as an office automation tool for managing regular reports, Access not being used to hold transaction data but data to do with the reports themselves. We use it to log and manage the requests for data and reports coming into the area.

We run SAS EG 4.1 still (along with a host of other studff compared with which 4.1 is a spring chicken) with SAS on a Unix box. Some of the directories there are mapped to the Windows LAN so the idea as a first stage semi-automation is in the first instance for the Access application to write a parameter text file from which the SAS program can read the parameters and populate its macro variables before getting to the meat of the SAS. It works well and is pretty simple but we still need to open the SAS code in SAS EG, submit the job, wait for it to finish and then exit from SAS.

We have the MS Office Add-in for Office and from Excel I can read the SAS tables on the server in Excel etc but   when I try to run sample code such as Chris's
Script.JPG

it bombs out on the CreateObject line with an ActiveX error, with 4.1 or just 4 as the version number making no difference.

I've seen various specifications regarding what references one must configure to invoke a SAS.

This one is about the minimum but copying what it specifies makes no difference

References.JPG

Using ActiveX2.8 doesn't help and going in and selecting all the SAS the SAS references that dialog box offers does not help either, i.e. as per this example

ReferencesFull.JPG

Any pointers to the missing link would be greatly appreciated.


Script.JPG
3 REPLIES 3
ChrisHemedinger
Community Manager

In EG 4.1, the automation model is a bit different. The complete reference information is at:

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

(There is a CHM file in the ZIP archive.  Extract it, then right-click, select Properties, and "unblock" it - else you won't be able to view the content...)

Here is an example VB Script:

Dim prjName
Dim prjObject
Dim app

prjName = "C:\EG 4.1 projects\mailinghtml.egp"    'Project Name
Set app = CreateObject("SASEGObjectModel.Application.4")
Set prjObject = app.Open(prjName,"")
prjObject.Run
' Save the new project results
prjObject.Save
prjObject.Close
app.Quit

First try to create a standalone VBS file and confirm that it runs with cscript.exe or wscript.exe.  If it does, then the equivalent script in VBA should work as well.

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
Josh
Calcite | Level 5

VBS first was a good suggestion as the error still occurred with "SASEGObjectModel.Application.4" but the dialog was a bit more informative: Error code 800A01AD. Googling that lead me to searching the registry (its Windows XP Professional at work) and there is no occurrence of "SASEG", let alone that string followed by anything else. There are a few entries commencing with "SAS.EG*" and "SASObjectManager" though. Is there a DLL which needs to be on the machine to support the object model? If there is but it is not there that would be indicative of the need to look elsewhere, or just manually run SASEG and click on the run icon.

ChrisHemedinger
Community Manager

You might try to remedy that issue with this note:

http://support.sas.com/kb/34/194.html

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1227 views
  • 0 likes
  • 2 in conversation