BookmarkSubscribeRSS Feed
Hedegaard
Calcite | Level 5

Hello,

With the following code, I am opening Excel, opening a specific file and running a macro in that file. The only problem is that between opening the specific file and running the macro it contains, Excel pops up with the prompt that asks me if I want to run the file with or without macros, and I have to manually choose "With macros" before my SAS program continues. Can I get SAS to either ignore this prompt or to automatically choose "With macros"?

Edit: By the way, I would like my code to be able to run on other people's computers as well, so the solution where I turn off the prompt in Excel is a last way out.

START OF CODE.

x ' "C:\Program Files\Microsoft Office\OFFICE11\excel.exe" ';

filename EXCEL DDE 'EXCEL|SYSTEM';

data _null_;

     x = sleep(3);
run;

data _null_;
     file excel;

     put '[open("L:\sasdata\Test\rhk\skrbest15\rapporteringsmakro.xls")]';
     put '[RUN("rapporteringsmakro.xls!Rapportering")]';

run;

END OF CODE.

Kind regards,

Rasmus Hedegaard.

1 REPLY 1
Doc_Duke
Rhodochrosite | Level 12

This is a tough one.  I think that message is present (or suppressed) based on a registry setting in Windows.  If the users have a certain amount of administrative access to their own computers, you could use any one of the registry editing programs to set up a small executable to modify the registry.  If not, your network admins would have to do it with their tools.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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
  • 1 reply
  • 1086 views
  • 0 likes
  • 2 in conversation