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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.