The SAS Output Delivery System and reporting techniques

Formatting in ODS Excel Print_Header

Occasional Contributor
Posts: 5

Formatting in ODS Excel Print_Header

In tagsets.excelXP, I was able to add &B or &14 to make my header bold or 14 point font, etc.  This causes my xlsx ODS Excel book to be corrupt and unable to be opened.  Is there a solution?

Posts: 8,739

Re: Formatting in ODS Excel Print_Header

[ Edited ]

What code did you use? Also, did you use TAGSETS.EXCELXP or ODS EXCEL. The approved file extension for ODS EXCEL is .XLSX and the approved file extension for TAGSETS.EXCELXP is .XML -- you should not use a file extension of .XLSX with TAGSETS.EXCELXP.

When I tested in 9.4, ODS TAGSETS.EXCELXP worked and made the header string bold and italic, as shown below. Then I tested in ODS EXCEL -- same code and I only changed 2 things -- I changed the destination to ODS EXCEL and I changed the file extension to .XLSX and that worked too.


TAGSETS.EXCELXP test using file extension .XML



ODS EXCEL test using file extension .XLSX


Frequent Learner
Posts: 1

Re: Formatting in ODS Excel Print_Header

Hi process,
Have you tried the same file with. Xls extension?
SAS Employee
Posts: 284

Re: Formatting in ODS Excel Print_Header

As Cynthia said, you must use .xml for the extension for files created by the ExcelXP tagset.  Do not use .xls or .xlsx, otherwise Excel will report an error when opening the file:


When you open a file in Microsoft Office Excel 2007 or later that contains content that does not match the files extension, you receive the following warning message: 

The file you are trying to open, 'name.ext', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?


Error opening file: "The file format differs from the format that the file name extension specifies"


Vince DelGobbo


Ask a Question
Discussion stats
  • 3 replies
  • 1 like
  • 4 in conversation