Issue while Export to Excel in Ax 2009

Dear All,

I want export the Data to Excel manually by My coding…Totally records around 22000 in Grid and 33 Columns.

While exporting the data, the following error occurred…

“Method ‘value’ in COM object of class ‘Range’ returned error code 0x80020005 (DISP_E_TYPEMISMATCH) which means: One or more of the arguments could not be coerced.”

How to fix it?

Look at the line of code throwing the error. It seems that you’re using a parameter of the wrong type there.

Some time this error occur

“The number of arguments provided is different from the number of arguments accepted by the method.”

Hi Martin,

Totally 22000 records in Grid.

Based on Date Filter, need to export 1000 or 2000 records…It exported the data to excel successfully in certain date filter.

But Sometimes the above error raised,

“Method ‘value’ in COM object of class ‘Range’ returned error code 0x80020005 (DISP_E_TYPEMISMATCH) which means: One or more of the arguments could not be coerced.”

Sometimes this error also raised,

“The number of arguments provided is different from the number of arguments accepted by the method.”

Yes, you already said that before and my answer is still the same. I obviously can’t be more specific, because I don’t have access to your code.

Finding which method call is throwing the error is the next step of debugging you should perform.

Thanks Martin,

Totally 1524 Records Between the Date 27-May-2013 to 26-May-2014.

First Time exported the record, Its shows the above error in 92 record.

After that I put Breakpoint, This time there is no error.

3rd Time I have removed breakpoint,working properly.

then again checked without Breakpoint, 4th time raised same error.

I am confused due to this.

Dear All,

I fill the grid from temp table. I add two column to the grid to show extra information.

I want to export grid information to Excel I am getting that error:

An error occurred while exporting the data to Excel. Please contact your system administrator.

How can I solve this?