BookmarkSubscribeRSS Feed
ProcWes
Quartz | Level 8

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?

7 REPLIES 7
Cynthia_sas
SAS Super FREQ

Hi:
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.

cynthia

TAGSETS.EXCELXP test using file extension .XML

tagsets_bold.png

 

ODS EXCEL test using file extension .XLSX

ods_excel_header.png

SachinKM
Fluorite | Level 6
Hi process,
Have you tried the same file with. Xls extension?
Vince_SAS
Rhodochrosite | Level 12

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"

http://support.microsoft.com/kb/948615

 

Vince DelGobbo

SAS R&D

ProcWes
Quartz | Level 8

I'm not sure if you meant to reply to someone else, but my question was regarding using ODS Excel.  Have a good day.

Vince_SAS
Rhodochrosite | Level 12

I did mean to reply to you.

 

Cynthia asked some questions but you haven't answered.  Without knowing the code you are using or the exact error message that you received, we can only guess at an answer.

 

You need to provide better information.

 

Vince DelGobbo

SAS R&D

ProcWes
Quartz | Level 8
My information was fine. I asked about getting a bold header using ODS Excel and you responded with what format to use with ODS Tagsets.ExcelXP.

That's why I assumed you were lost - you answered a question that nobody asked. That's the same thing Cynthia did.

Have a good day.
Cynthia_sas
SAS Super FREQ
Hi: I'm sorry you feel I did not answer your question. However, in my posting, I showed the SAME code working in both TAGSETS.EXCELXP and ODS EXCEL to make the print header both BOLD and ITALIC in output from the ODS EXCEL destination and TAGSETS.EXCELXP destination.

The PRINT_HEADER suboption is the same in both destinations. Did I misunderstand your original question. In my screen shot for ODS EXCEL, the header IS bold.

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 7 replies
  • 2769 views
  • 1 like
  • 4 in conversation