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


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Dragon,

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

Exception 0x800ac472 when accessing Excel
Solution for Excel Exception 0x800AC472 in c#.net
HRESULT 800ac472 from set operations in Excel

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?
.NET, Extended MAPI, Windows Phone & RT
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


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Dragon,

Sure. Did you try to use the ScreenUpdating property of the Application class in Excel?
.NET, Extended MAPI, Windows Phone & RT
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


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Dragon,

Please take a look at the similar forum thread. Does it help?
.NET, Extended MAPI, Windows Phone & RT
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


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Dragon,

Thank you for letting me know and good luck with your add-in project!
.NET, Extended MAPI, Windows Phone & RT
Posted 09 Sep, 2011 01:18:34 Top