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.
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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.