One of the nice features of Dynamics AX 2009 is the Export to Excel that is available throughout the product and allows to content of a Grid to be exported to Microsoft Office Excel for further analysis. Sometimes however the feature does not work as expected. So for example Microsoft Office Excel is starting but the data from the Grid is not showing up.
The Export to Excel is not completely happening in the Dynamics AX Kernel but parts of the export logic are coded in X++:
The Windows Clipboard is playing a central role in the Export to Excel. Between the placing of the data in the Windows Clipboard and the retrieving of the data by Microsoft Office Excel several steps are happening. If for any reason the content of the Windows Clipboard is altered or replaced during this time the export will fail.
One cause of problems can be Add-Ins for Microsoft Office Excel. Add-Ins are loaded when Microsoft Office Excel starts and can manipulate the content of the Windows Clipboard before Dynamics AX had any chance to paste the content at a worksheet.
In order to find out what is happening during the export of data the Dynamics AX Debugger can be of a great help. Simply by putting a breakpoint at the beginning of the method performPushAndFormatting and checking the content of the Windows Clipboard while executing line after line.