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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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