What I need to do is the following:
1) open an XLSX workbook template with SAS (no problem)
2) save the same XLSX file under another name as an XLSX using sas (can only get it to do XLS).
I have two macros and the first one works fine to open the template. Saving it as an XLSX is a bit of an issue. I am using Version 9.2 TS2M3.
filename cmds dde "EXCEL|SYSTEM";
/* Save current workbook using new name */
data _null_;
file cmds;
put '[error(false)]';
put "[save.as(%bquote("&_xlsfile"
,&_type_num
))]";
run;
/* Close DDE SYSTEM COM Channel */
filename cmds;
What version of Excel are you using?
What happens if you do a Save.as with just first parameter, the filename?
put "[save.as(%bquote("&_xlsfile"))]";
What version of Excel are you using?
What happens if you do a Save.as with just first parameter, the filename?
put "[save.as(%bquote("&_xlsfile"))]";
I was able to locate some information stating that type = 51 is xlsx. This seems to work fine also.
Yet another reason to avoid DDE if at all possible. That value of 51 could well be different in the next release of Office.
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.