The SAS Output Delivery System and reporting techniques

Excel file not created using MSOFFICE2K and .xls extension

Accepted Solution Solved
Reply
Contributor
Posts: 53
Accepted Solution

Excel file not created using MSOFFICE2K and .xls extension

We have been using the MSOFFICE2K tagset to generate and stream .xls files with _WEBOUT in a stored process. Although we received the dialog box warning that the format of the file is not as expected our users were okay with responding Yes.

 

However, after the most recent Microsoft Office 2013 updates were applied to all of our computers this doesn't work anymore. Excel does open when we select to open the file but all we get is a blank gray screen.

 

We are on SAS 9.4 M2 so ODS EXCEL is not fully supported. Any suggestions as to what may be happening after this update from Microsoft?

 

data _null_;

rc = stpsrv_header('Content-type','application/vnd.ms-excel');

rc = stpsrv_header('Content-disposition','attachment; filename=Dept_list_courses.xls');

run;

ODS LISTING CLOSE;

ODS tagsets.msoffice2k BODY=_webout style=seaside;

-proc report code follows-


Accepted Solutions
Solution
‎07-27-2016 02:11 PM
Super User
Posts: 19,865

Re: Excel file not created using MSOFFICE2K and .xls extension

1. Check your Trust Center settings

2. Try downloading a file and opening from within Excel - this isn't workable long term but if you get a warning or note it may help diagnose the problem

View solution in original post


All Replies
Solution
‎07-27-2016 02:11 PM
Super User
Posts: 19,865

Re: Excel file not created using MSOFFICE2K and .xls extension

1. Check your Trust Center settings

2. Try downloading a file and opening from within Excel - this isn't workable long term but if you get a warning or note it may help diagnose the problem

Contributor
Posts: 53

Re: Excel file not created using MSOFFICE2K and .xls extension

I compared the Trust Center settings to those on a computer that does not have the update applied and they are the same.

 

I am able to save the file from the web, instead of open, and then open it successfully in Excel. Some users have said that it didn't work for them, however. This solution will work temporarily until we can upgrade to SAS 9.4 M3.

 

Thanks so much for your suggestions.

SAS Super FREQ
Posts: 8,868

Re: Excel file not created using MSOFFICE2K and .xls extension

Here's some more background. When you use MSOFFICE2K, you are not creating an Excel proprietary file just because you use an extension of .XLS and even with the Content-type header, Excel knows, when it goes to open the file that the "true" inner workings of the file are HTML and you are trying to "fool Excel" by naming the file XLS. Ever since Office 2007, you will get that snarky message from Excel when you try to open an HTML file that has been named as .XLS instead of .HTML. The only way to avoid the snarky message from Excel is to change the Windows registry, which is generally frowned upon or to do what you are doing and Save AS xls or just educate your users to click Yes when they get the message about the mismatch between the extension and the actual file contents.

cynthia
And, when you can use ODS EXCEL, you won't get that snarky message anymore. (something to look forward to)
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 331 views
  • 1 like
  • 3 in conversation