I've got HTML tables (Proc print, means etc.) generated from SAS batch jobs (Windows Server) that I can right click and select download to Excel and the data exports perfectly!
When I do the same with an HTML table generated from the SSPWA, it gives me an Excel query error and doesn't export the data.
I've compared the (view source) source generated from both methods and they seem identical right down to the number of lines.
Anyone know why I can't download an HTML table to Excel generated from the SSPWA?
1. When you say you have html files that you can right click and select "download to Excel", what do you mean? You mean in Windows explorer you can right-click the file and select download to Excel? Or do you mean in Internet explorer you can view an .html file with a table in it, and right-click the table and select download to Excel? Or something else?
2. You have two .html files (one produced by your batch job which works as you want, and one produced by SPWA which doesn't work as you want). If you diff those two files, they are exactly the same?
To clarify, using HTML files (tables) created from sas batch jobs, in Internet Explorer I can RMB and there is an option to download to Excel and it works.
In a HTML file (tables) created from SPWA, in Internet Explorer I can RMB and there is an option to download to Excel and it doesn't work. Same coded used in batch job was converted to a stored proc and executed from SPWA.
Viewing the source code from IE, show they are the same.
I googled "Internet Explorer" and "Export to Excel" (which is the RMB option I have in IE 😎 and found plenty of complaints about this IE feature being buggy:
So would suggest you check the IE support boards for your version of IE, bitness, etc (or try SAS support, as Cynthia suggested).
If the goal is to use SPWA to generate an Excel file (or Excel-like file), you could so that in other ways, e.g. writing results with destination as tagsets.excelxp or something else Excel is happy to open.
Note that what you are seeing is consistent with the issue described in the link I posted:
When I attempt to use this facility [RMB -> export to Microsoft Excel] from any "http://" sites, the resulting "New Web Query" dialog that is presented by Excel shows an
Address of http:/// and displays a standard browsing error of "This program cannot display the webpage". However this facility still works fine for any local [html] files that I load directly into the browser.
So my money is on IE bug, not SAS bug.
Note if you follow the thread, it's 2 years of people complaining about this being broken in IE9, followed by one post in 2013 saying it seemed to work for them in IE10.
Please post if you or tech support come up with a solution or definitive diagnosis. I never knew IE had this feature. Could be useful, if it can be made to work reliably.
Sometimes with the SPWA you have to send a content-type header and use the STPSRV_HEADER to make that happen in your program. Like Quentin, however, I don't exactly understand the scenario you are describing. EG would let you RMB and then do a send to Excel, but the SPWA doesn't do that with Stored Process results. It might be better if you worked with Tech Support on this. Working with Stored Processes and the Platform and the SPWA might mean your Stored Process needs some tweaking, which means that someone has to look at ALL your stored process code and output to see why it is (allegedly) behaving differently than the other code and output.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.