BookmarkSubscribeRSS Feed
Jyuen204
Obsidian | Level 7

I have an excel report I built that drop the file into my ftp drive. when I open the file I get a "File Format and Extension .... don't match.."

I can still bypass and open the file. Just wondering if there is a way to have the program be exported "properly" so that the error doesnt pop up. 

 

ods tagsets.ExcelXP path= "&OUTPUT_PATH" file= 'Weekly Report.xls' Style=Printer;

 

I tried xlsx as the extension but it wont open the file at all.

4 REPLIES 4
ballardw
Super User

@Jyuen204 wrote:

I have an excel report I built that drop the file into my ftp drive. when I open the file I get a "File Format and Extension .... don't match.."

 


Of course you do. The EXCELXP creates XML content. Not XLS. Not XLSX. Not HTML. You may get away with XLSX, but the file should have an XML extension.

 

You may have to add XML to whatever program you are using to view XLS files as a default application.

Jyuen204
Obsidian | Level 7
Is there a different method of export where I can export the report to the excel format? I inherited this code from someone who is long gone.
Tom
Super User Tom
Super User

SAS now had the EXCEL destination you can use that writes an XLSX file.

 

There are some minor differences in what options the two support, so you might need to also make some other changes.

SASKiwi
PROC Star

Try writing the file with an XML file extension. That's what we do with our ExcelXP spreadsheets and Excel opens it successfully by double-clicking on it.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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
  • 4 replies
  • 854 views
  • 2 likes
  • 4 in conversation