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

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.

 

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