BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SASMike
Obsidian | Level 7

Greetings!

I have been acclimating myself to the ODS ExcelXP facility lately and I've run into an issue generating files.  The issue only occurs when using the "minimal" style oddly. The SAS log does not generate any errors but when attempting to open the spreadsheet (via Excel 2010) I run into the following error.  Other styles work perfectly and do not generate errors - just minimal.  I've verified that the "minimal" style works perfectly with other outputs (HTML, PDF).  I've even opened the style CSS itself and confirmed it's existence.  It does not matter if I use the extention .xls or .xml...same error.   Any help would be much appreciated!

Thank you!!!

SAS Mike

Excel error upon attempt to open:

Error.jpg

Here's the Excel log file:

XML ERROR in Table

REASON: Bad Value

FILE: C:\Users\kj1062\Desktop\myexcel.xls

GROUP: Row

TAG: Cell

ATTRIB: StyleID

VALUE: notecontent__c

XML ERROR in Table

REASON: Bad Value

FILE: C:\Users\kj1062\Desktop\myexcel.xls

GROUP: Row

TAG: Cell

ATTRIB: StyleID

VALUE: notecontent__c

XML ERROR in Table

REASON: Bad Value

FILE: C:\Users\kj1062\Desktop\myexcel.xls

GROUP: Row

TAG: Cell

ATTRIB: StyleID

VALUE: notecontent__c

XML ERROR in Table

REASON: Bad Value

FILE: C:\Users\kj1062\Desktop\myexcel.xls

GROUP: Row

TAG: Cell

ATTRIB: StyleID

VALUE: notecontent__c

Here's my SAS code:

ODS TAGSETS.ExcelXP

  FILE="C:\Users\kj1062\Desktop\myexcel.xls"

  STYLE=minimal

  OPTIONS  ( EMBEDDED_TITLES='Yes'

  SHEET_NAME='PROC PRINT'

  FROZEN_HEADERS='3');

TITLE BOLD COLOR=BLACK "ODS Excel Test - PROC PRINT";

PROC PRINT DATA=SASHELP.CARS OBS='Observation #' SPLIT='*'; *SPLIT implies LABEL;

  VAR Make / STYLE=[JUST=RIGHT TAGATTR='format:text'];

  VAR MSRP;

  WHERE Make='Audi';

RUN;

ODS TAGSETS.ExcelXP

  OPTIONS  ( SHEET_NAME='PROC REPORT');

TITLE BOLD COLOR=RED "ODS Excel Test - PROC REPORT";

PROC REPORT DATA=SASHELP.CARS (WHERE=(Make='Porsche')) MISSING NOWD

  STYLE(HEADER)=[FONT_WEIGHT=BOLD JUST=CENTER BORDERWIDTH=1]

  STYLE(COLUMN)=[JUST=CENTER BORDERWIDTH=1];

  COLUMN Make MSRP;

  DEFINE MSRP / F=DOLLAR20.;

  COMPUTE AFTER /* STYLE=[] */;

  LINE "";

  LINE "1. Footnote one";

  LINE "2. Footnote two";

  LINE "https://www.google.com";

  ENDCOMP;

RUN;

ODS TAGSETS.ExcelXP CLOSE;

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  Did you search support.sas.com? This Tech Support note (39769 - An incorrect file might be generated when using version 1.86 and below of the ExcelXP tagset...) seems to indicate that there is some kind of known problem, which, if encountered, should lead you to contact Tech Support. BTW, in SAS 9.4, there is still a problem with STYLE=MINIMAL and TAGSETS.EXCELXP, but the code ran fine using STYLE=SASWEB.

cynthia

View solution in original post

5 REPLIES 5
ballardw
Super User

The LINE statements in the Compute After block if your set up is similar mine, SAS 9.2.3,

reference a style ID that was not defined the XML style definitions.

 

StyleID="notecontent__c"

At least when I manually edit the XML with another defined style replacing that the result displays in Excel.


SASMike
Obsidian | Level 7

I'm not sure why :smileyconfused: but when using the 'minimal' style, there are issues when using a COMPUTE block.  The errors that are generated relate directly to those COMPUTE lines.  Unless someone has a solution, I'll have to build a workaround.

Appreciate your response ! Smiley Happy

  COMPUTE AFTER /* STYLE=[] */;

  LINE "";

  LINE "1. Footnote one";

  LINE "2. Footnote two";

  LINE "https://www.google.com";

  ENDCOMP;

The four COMPUTE lines each generate an error in the Excel log file. 

Cynthia_sas
SAS Super FREQ

Hi:

  Did you search support.sas.com? This Tech Support note (39769 - An incorrect file might be generated when using version 1.86 and below of the ExcelXP tagset...) seems to indicate that there is some kind of known problem, which, if encountered, should lead you to contact Tech Support. BTW, in SAS 9.4, there is still a problem with STYLE=MINIMAL and TAGSETS.EXCELXP, but the code ran fine using STYLE=SASWEB.

cynthia

SASMike
Obsidian | Level 7

That explains a lot.  I will have to incorporate another style to circumvent this issue.  

Thank you very much !!! Smiley Happy

SASMike
Obsidian | Level 7

Solution Follow-Up:

I was able to find a solution to this problem by installing the newest version of the ExcelXP tagset from this link:  Base SAS: ODS MARKUP

There is a help note about installation here: 32394 - Installing and Storing Updated Tagsets for ODS MARKUP

This solved the issues I was having with the 'minimal' style.  I cannot guarantee this will solve the issue for everyone, however, it did work for me.

Thanks all! Smiley Wink

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 5 replies
  • 3862 views
  • 3 likes
  • 3 in conversation