Support Article
Export to excel error if active excel already open
SA-28530
Summary
When attempting to export a page list to Excel when Excel is already open on the local machine, an error is thrown: "Unable to read file". The excel screen is blank.
Error Messages
Unable to read file
Steps to Reproduce
1. Create a Data Page backed by a Page List generated from Activity through a Report Definition (RD).
2. Use this data page in a repeat grid.
3. Add a button and on-click, call the Export to Excel activity by passing the page name parameter.
4. Run the application and click Export button.
5. Try to 'Open' the Excel document (without saving). If there are no active MS Excel files open then the exported Excel document will 'Open' with data displayed.
6. If there is any active MS Excel open then you will see the error -"Unable to read file"
Root Cause
The root cause is a timing issue between Microsoft products.
When Excel is open, Internet Explorer allows the document to be opened by Excel before it has fully downloaded, causing an incomplete and unreadable file to be picked up by Excel.
Resolution
Users have three options to avoid running into the issue in Pega 7.1.9:
1. Wait long enough before clicking "Open". Internet Explorer 11 provides a clue when the download is completed.
When the user clicks Export to Excel link, at first the security dialog looks like this (notice the color):
As long as the user avoids hovering mouse cursor over the dialog and waits for a while, the dialog will blink and change color:
At this point click the "Open" button and the export will succeed.
2. Instead of “Open”, pull down “Save”, select “Save As” option, and then open saved file in Excel. This requires more clicks, but does the job.
3. Use browser other that Internet Explorer 11, for example,Chrome or Firefox browser.
Published October 6, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.