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