DATA Step, Macro, Functions and more

Saving an XLSX template as an XLSX using SAS

Accepted Solution Solved
Reply
Contributor
Posts: 30
Accepted Solution

Saving an XLSX template as an XLSX using SAS

[ Edited ]

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;

 


Accepted Solutions
Solution
‎04-27-2016 02:41 PM
Super User
Posts: 19,815

Re: Saving an XLSX template as an XLSX using SAS

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


All Replies
Solution
‎04-27-2016 02:41 PM
Super User
Posts: 19,815

Re: Saving an XLSX template as an XLSX using SAS

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

 

 

Contributor
Posts: 30

Re: Saving an XLSX template as an XLSX using SAS

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

Super User
Posts: 11,343

Re: Saving an XLSX template as an XLSX using SAS

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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 301 views
  • 0 likes
  • 3 in conversation