Desktop productivity for business analysts and programmers

Invoke VBA macro from Enterprise Guide

Reply
New Contributor
Posts: 2

Invoke VBA macro from Enterprise Guide

In base sas we can invoke vba macro using DDE and X commands. But how can we do same in EG?

Super User
Posts: 1,230

Re: Invoke VBA macro from Enterprise Guide

DDE doesn't work in SAS workspace servers or stored process servers (often accessed with SAS Enterprise Guide). Chris Hemedinger wrote a great blog post about the ways to export from SAS to Excel files which may help provide some alternative methods... You may also find the comments helpful... How do I export from SAS to Excel files: Let me count the ways - The SAS Dummy

The ability to use a X command depends on the configuration your SAS Administrator has set. You may find this blog post by Paul Homes useful NOXCMD: NO eXternal CoMmanDs! - platformadmin.com

KInd Regards,

Michelle

New Contributor
Posts: 2

Re: Invoke VBA macro from Enterprise Guide

Hi Michelle,

Thanks for the reply but my requirement is not to read excel data but invoke VBA macro using EG.

In base sas we can use filename with DDE engine and then use put RUN statement to run vba macro.

But this can not be done in EG as DDE is not supported.

Super User
Posts: 1,230

Re: Invoke VBA macro from Enterprise Guide

I understand... and that's right DDE is not a technology that is supported in EG. So depending on what your VBA code does, another technique such as the excel libname engine may be the approach to take.

Kind Regards,

MIchelle

Community Manager
Posts: 2,697

Re: Invoke VBA macro from Enterprise Guide

Depending on what it is you're trying to do, you might be able to use a PowerShell script.  I've got several examples of SAS + PowerShell here:

PowerShell - The SAS Dummy

For this to work you would still need XCMD privileges.  My examples don't include Excel automation, but those are easy to find with a web search.

Chris

Ask a Question
Discussion stats
  • 4 replies
  • 1065 views
  • 1 like
  • 3 in conversation