Bug in Excel? Excel Multithreading ERROR

  • Thread starter Thread starter JCChin
  • Start date Start date
J

JCChin

Hi, I am writing an multithreaded Excel Add-in program and an error. I
currently have no clue how to solve this. Please help. The description is as
below:

I created an Excel Add-in in C#. The add-in contains a separate thread that
read and write to the worksheet constantly.

I got a COMException when the program is accessing to the cell while I
clicking on the worksheet.

HRESULT of the exception is: 0x800AC472

I could mitigate this problem by having the add-in to retry after this
exception occur. However, Excel will not exit cleanly after exception occur.
That is, the Excel process still running after my add-in have been shutted
down and Excel window closed. I have to kill the process manually :(

Anyone having the same problem?
 
JCChin said:
Hi, I am writing an multithreaded Excel Add-in program and an error. I
currently have no clue how to solve this. Please help. The description is as
below:

I created an Excel Add-in in C#. The add-in contains a separate thread that
read and write to the worksheet constantly.

I got a COMException when the program is accessing to the cell while I
clicking on the worksheet.

HRESULT of the exception is: 0x800AC472

I could mitigate this problem by having the add-in to retry after this
exception occur. However, Excel will not exit cleanly after exception occur.
That is, the Excel process still running after my add-in have been shutted
down and Excel window closed. I have to kill the process manually :(

Anyone having the same problem?

I think it's a bad idea to write a multi threaded add-in. My guess is that
Excel is not in the state it should be in when this add-in tries access a
cell while you try to access some other cell. Why does it constantly have to
read and write to the worksheet?

/Fredrik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top