0x800AC472 exception if the Excel window loses focus ...

Add-in Express™ Support Service
That's what is more important than anything else

0x800AC472 exception if the Excel window loses focus ...
 
Dragon Fly




Posts: 76
Joined: 2011-07-27
Hi,

My addin has an Update button. If the user clicks on the Update button, a bunch of cells get updated (e.g. range.Value2 = firstRowData) and the update could take several minutes. This works fine if the Excel window has focus during the entire update process. If the Excel window loses focus (e.g. click on another application so that the Excel window goes behind another window) during the update process, a 0x800AC472 exception is thrown. I doubt that it's an add-in express issue but I was hoping that someone could shed some light on what the problem is. Thank you.
Posted 18 Aug, 2011 09:01:14 Top
Eugene Astafiev


Guest


Hi Dragon,

I have found a lot of similar forum threads related to Excel. Some of them are listed below:

http://www.pcreview.co.uk/forums/exception-0x800ac472-accessing-excel-t948185.html
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/a14d3e58-f9b7-4b94-aa24-ae006c0d245c/
http://social.msdn.microsoft.com/forums/en-US/vsto/thread/9168f9f2-e5bc-4535-8d7d-4e374ab8ff09/

Also you may be interested in the ScreenUpdating property of the Application class in Excel. Did you try to set it to false when you run a time-consuming task?
Posted 18 Aug, 2011 10:32:42 Top
Dragon Fly




Posts: 76
Joined: 2011-07-27
Eugene,

I googled a bit before posting the message. I went through quite a few links similar to the ones that you provided but they didn't really help. Let me think about it more and perhaps I'll have more questions. Thank you.
Posted 19 Aug, 2011 10:33:39 Top
Eugene Astafiev


Guest


Hi Dragon,

Sure. Did you try to use the ScreenUpdating property of the Application class in Excel?
Posted 19 Aug, 2011 11:13:35 Top
Dragon Fly




Posts: 76
Joined: 2011-07-27
Yes, ScreenUpdating was the property that threw the 0x800AC472 exception.
Posted 22 Aug, 2011 06:46:28 Top
Eugene Astafiev


Guest


Hi Dragon,

Please take a look at the http://www.dotnetmonster.com/Uwe/Forum.aspx/vs-net-office/1123/Multithreading-vsto-2003 forum thread. Does it help?
Posted 22 Aug, 2011 06:58:54 Top
Dragon Fly




Posts: 76
Joined: 2011-07-27
I ended up changing the logic to not have two threads updating Excel to fix the problem.
Posted 08 Sep, 2011 11:53:47 Top
Eugene Astafiev


Guest


Hi Dragon,

Thank you for letting me know and good luck with your add-in project!
Posted 09 Sep, 2011 01:18:34 Top