Search This Blog

Wednesday 23 July 2014

Export to Excel: The number of arguments provided is different from the number of arguments accepted by the method.

I was working on excel based reports was getting the following error:

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

After debugging I found out that when I going to insert the text in excel this error was generating.

the code that was reproducing this error is:

cell.value("my text");

The best solution to get rid of this error is that we should open our workbook for very less amount of time.We should first complete all of our calculations and than open the workbook and  insert the records in excel sheet. 

If the issue is not resolve by applying the above workaround than there are also some other solutions available you can see on the below link:  



I hope you like this post.

Thanks

Muhammad Zahid.