BookmarkSubscribeRSS Feed
mbinde
Calcite | Level 5

Hi

I have tried everything 🙂

Hope you have some other ideas?

 

We have created some data in a SAS table, and want to export it to Excel.

I am trying to execute this code to open my data in Excel

 

proc template;
   define style styles.mwastyle;
   style fonts /
     'titlefont' = ('Arial, Albany AMT, Times, Verdana, Helvetica',12pt,bold)
     'headerfont' = ('Arial, Albany AMT, Times, Verdana, Helvetica',12pt,bold)
     'rowheaderfont' = ('Arial, Albany AMT, Times, Verdana, Helvetica',12pt,bold italic)
     'datafont' = ('Arial, Albany AMT, Times, Verdana, Helvetica',10pt)
     'datasumfont' = ('Arial, Albany AMT, Times, Verdana, Helvetica',10pt,bold)
     'footerfont' = ('Arial, Albany AMT, Times, Verdana, Helvetica',12pt,italic)
   ;
   style systemtitle /
      font = fonts('titlefont')
      protectspecialchars = off
   ;
   style header /
      font = fonts('headerfont')
      protectspecialchars = off
   ;
   style data /
      font = fonts('datafont')
      protectspecialchars = off
   ;
   style dataemphasis /
      /*font = fonts('datasumfont')*/
      font = fonts('datafont')
      protectspecialchars = off
   ;
   style body /
      font = fonts('datafont')
      protectspecialchars = off
   ;
   end;
run;

 

      %LET FELT_MSO_FORMAT_TEXT     = ; 
      %LET FELT_MSO_FORMAT_TEXT     = ;
      %LET FELT_MSO_FORMAT_0DEC     = ;
      %LET FELT_MSO_FORMAT_2DEC     = ; /*style={tagattr='format:[Red]\($#,##0\)'};*/
      %LET FELT_MSO_FORMAT_4DEC     = ;
      %LET FELT_MSO_FORMAT_2DEC_PCT = ;
      %let reportno   = %sysfunc(int(%sysfunc(datetime())));

       %let old_header = %sysfunc(stpsrv_header(Content-type,application/vnd.ms-excel));
       %let old_header = %sysfunc(stpsrv_header(Content-disposition,%str(attachment;filename=Rapport_&reportno..xlsx)));
 
      OPTIONS MISSING='';
 
      ODS EXCEL FILE = _WEBOUT STYLE = mwastyle  
                  options(/* for multiple procs/sheet */
                  sheet_interval ="none"    
                  embedded_titles="yes"   
                  sheet_name     ="&TITEL1" 
                  frozen_headers ="off"    
                  autofilter     ="no"      
                  );

 

After this I also Close the ODS Excel file.

Then Excel opens, and Excel throws the message "We found a problem with some content in FILENAME.XLSX. Do you want to try to recover as much data as we can"

If I says Yes, then my data opens fine, and everything is as I expects.

Excel has not lost any data at all.

Can anyone understand, what it is, I am not setting up, to let me allow to open my data in excel, with out the message.

If I save the data in excel, without doing any changes to it. It opens fine, without any message, the next time i open file.

 

It is Excel 365 proplus

Thanks in advance

3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
This is probably a question for Tech Support it looks like you're using a Stored Process and a custom style -- is that correct? Tech Support needs to look at ALL your code -- not just the style template and the ODS top statement.
Cynthia
mbinde
Calcite | Level 5

Hi

Yes You are right. It is from a stored process. How do I raise this to Tech Support, so I can perhaps show them the entire flow(code)

Thanks 

Cynthia_sas
SAS Super FREQ

Hi:

To open a track with Tech Support, fill out the form at this link: http://support.sas.com/ctx/supportform/createForm or send mail to support@sas.com . Be sure to include your site license number. You don't have to send them everything the first time you make contact, they will verify your details and then assign your track to the right group. Then you'll be asked for full details and code and error messages.

Cynthia

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1504 views
  • 0 likes
  • 2 in conversation