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.





5 comments:

  1. Hi,

    I am getting the same error.
    https://community.dynamics.com/ax/f/33/p/202857/526010#526010

    I have tried all the above solutions but still I am getting the same error and I am not yet through to catch the exact root cause for this issue.

    Can you please help me pass through it.

    -Muneeb

    ReplyDelete
  2. Hi,

    The cause of the issue is using a progressbar. Its that process that is causing the ghosting. I tried all workarounds above and nothing worked. Stopped using the processbar and i never had the errors again.

    workaround for the progress bar. use the infolog.viewUpdate() to focus the infolog when you added something. This way the user get messages while the process is ongoing.

    Br

    ReplyDelete
    Replies
    1. Thanks Mate ...:)
      Your workaround worked well..

      Delete
  3. Hi Chaoz,

    Where exactly we need to make this change?

    -Muneeb

    ReplyDelete
  4. I am also facing same error. Please suggest the solution for the same ?

    ReplyDelete