BookmarkSubscribeRSS Feed
KarthikSrivasthav
Calcite | Level 5

Hi all,

I want to automate my process can any one help me to execute the VBA codes through SAS.

Currently i am doing in three steps :

1) Executing SAS codes to get the data.

2) Exporting the datasets

3) Executing the VBA codes .

I want to make it into one step.Please help me and i have one more doubt how a SAS in Unix system interacts with Windows(Excel) system.

Thanks & Regards

Karthik Srivasthav...

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

As far as I am aware, Excel does not exist on Unix as it is a Windows system.  I imagine you are creating files on Unix which can be read by Excel, e.g. ods tagsets.excelxp, csv, but seeing as you can't start the office engine on Unix I don't see how you would execute VBA which embedded in Office.

Without further information its hard to say, but you could look at it the other way round.  Have your data exported from SAS as normal.  Then have an Excel file with an OnOpen sub which knows to load the exported datafile.  That Excel file could then run other macros as needed.

Oh, and just to add, why would you want to run VBA macros at the end.  Output from SAS is more of a review tool, Excel is not good for <insert task here>.

Doc_Duke
Rhodochrosite | Level 12

If you have Enterprise Guide available, you could package the steps inside EGuide and run the project.  You could even run the project unattended.  Chris H. has some guidance for embedding VBA in EGuide on the SAS Dummies blog.

You may also be able to embed the call for SAS execution in the SAS add-in for Microsoft Excel.  You may need additional product to get that to work.

Reeza
Super User

There's not enough information to answer your question.

Yes, it's possible but you need to explain in more detail what you'd like.

For starters:

Are you using SAS or EG? What version? Are you on a server or desktop or combination?

What do you mean by exporting the data sets? Why is that not part of the SAS program?

What does your VBA do? Can that be embedded in SAS?

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1382 views
  • 0 likes
  • 4 in conversation