Help using Base SAS procedures

Need Help to Save File as Excel workbook in 2007 format

Reply
Frequent Contributor
Posts: 82

Need Help to Save File as Excel workbook in 2007 format

I am using SAS to produce an Excel workbook. We have recently converted to MS 2007. The program works fine, I have only changed the extensions on the files to '.xlsx'. But when I try to open the file after closing Excel and SAS, in Excel 2007 it says the file if corrupted or the extension is wrong. How do I save the file as the new 2007 format. This is a piece of the current code that I have:

%let excelout = &newdrive&dirpath.\data\schips\&monyr\&mth&yr._mthlychk.xlsx;
data _null_;
file cmdexcel;
put "[save.as(%bquote("&excelout"))]";
run;

The SAVE.AS does not seem to be enough. How can I put the File Format into the put statement? Also are there any good examples on the web that show me different Excel commands and formats that can be used inside put statements from SAS?

Thanks, Nancy
Super Contributor
Super Contributor
Posts: 3,174

Re: Need Help to Save File as Excel workbook in 2007 format

Posted in reply to SASHunter
You topic/query has been discussed on the SAS forums before - suggest you search the archives. Also, there is "Excel version support" information on the SAS.COM support website at http://support.sas.com/ either using SEARCH or possible a Google advanced search argument, such as:

excel version 2007 support site:sas.com

Also, you will need to consider that SAS version support and related Excel version support may not generate an actual Excel 2007 format file for you, however you do have some options.

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 1 reply
  • 116 views
  • 0 likes
  • 2 in conversation