BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Doug____
Pyrite | Level 9

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;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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"))]";

 

 

View solution in original post

3 REPLIES 3
Reeza
Super User

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"))]";

 

 

Doug____
Pyrite | Level 9

I was able to locate some information stating that type = 51 is xlsx. This seems to work fine also.

ballardw
Super User

Yet another reason to avoid DDE if at all possible. That value of 51 could well be different in the next release of Office.

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
  • 3 replies
  • 1892 views
  • 0 likes
  • 3 in conversation