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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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