I was trying to export data to an excel spreadsheet earlier today and ran into something that I have not seen before:
Failed to Generate Excel
An error occurred when Dynamics 365 tried to generate the Excel file. If this problem persists, contact your system administrator.
This was happening on a seemingly innocent view which had lots of columns in it. And, as you can see from the screenshot above, there is not a lot of additional information I was able to find in the log file (since there was no log file).
Was it about the total number of columns? Was it something else? It could not be because of the large data set since I did not have that much data..
What you see on the screenshot below is a reproduction:
There are only a few columns in the view, but if you try to export data to excel from that view, you’ll get exactly the same error. The same will happen if you try to download an excel template using that view.
Notice how there are two different fields with the same display label in that view. That’s exactly what was causing the error – changing the display label for one of the fields so that display labels become unique in the view solves the problem: