BookmarkSubscribeRSS Feed
KarthikSrivasthav
Calcite | Level 5


Hi All,

I want to create a excel pivot with SAS by running VBA code .

Regards

Karthik

4 REPLIES 4
snoopy369
Barite | Level 11

I would look into DDE, if you can (google "SAS Excel DDE").  That allows SAS to tell Excel to do things, including run macros.

Vince28_Statcan
Quartz | Level 8

DDE has not been supported since 2003 maybe even earlier than that and is dying with 64 bit platforms/remote submission environments like EG or grid. Nonetheless, for local processes it can still achieve the desired results easier and faster than with some other means.

However, if you are looking for an expandable solution that will work for a long time, I would stay away from DDE.

If you have VBA knowledge, odds are it would be easier to do the opposite. I suggest you give a read to

https://communities.sas.com/thread/9841

I'd love to provide more insights but I've really only played with DDE myself and have not had anything of large enough scale to get into VB-SAS interaction

Vince

*edit Reeza -> Like!

Reeza
Super User

That solution assumes you have SAS Add in for Microsoft Office, which to me, in my experience is more unstable.

I'd go DDE. Currently using it with 64 bit SAS with 32 bit Excel 2010 and not having issues.  But generally, I embed a macro into the Sheet and then call that macro instead of using DDE to actually do things. 

There's also the ODS TableEditor option

Base SAS: Creating a Data Grid Like VB.NET

This is an old question, if the OP googled they'd find the answer easy enough Smiley Happy

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 4158 views
  • 1 like
  • 4 in conversation