ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Exception 0x800ac472 when accessing Excel (https://www.excelbanter.com/excel-programming/272140-exception-0x800ac472-when-accessing-excel.html)

Les Spiro

Exception 0x800ac472 when accessing Excel
 
We have an application that is polling an Excel sheet on
a timer using COM.

On overnight runs we often see OLE Exception with error
code = 0x800ac472.

These often coincide with clicking into Excel from a
screen saver or Windows XP switch to user screens.

If we trap the error and continue things seem OK, but I
was wondering if there is anything we can do to avoid the
exception.

We are running on Excel 2002 under Windows XP SP1

Les


Bill Lunney

Exception 0x800ac472 when accessing Excel
 
One problem with driving Excel through COM is the unknown state in which
Excel could be in. For example if you want to interact with an Excel
session which is in use by the user some COM calls will not work at certain
times. Can't remember the specific examples I came across but some dialogs
being open etc. would cause the COM call to fail. I never found a way to
trap all of these cases and ended up using workarounds.

You mention 'user screens'. Do you mean Excel forms? Can you also clairfy
if your interacting with an existing Excel session or in your code you are
instantiating a fresh Excel object and using it to load your file etc.

What I did was to trap all known/available errors as best I could and if
when, say getting data from a cell, failed I would just have to assume that
the user was doing something which was blocking the COM call and carry on.

This may account for what you say about trapping the error and continuing.
By doing so you're ignoring the failed call and on the next pass it's
possible Excel is back in a state where it can process the calls as normal.


--

Regards,


Bill Lunney
www.billlunney.com

"Les Spiro" wrote in message
...
We have an application that is polling an Excel sheet on
a timer using COM.

On overnight runs we often see OLE Exception with error
code = 0x800ac472.

These often coincide with clicking into Excel from a
screen saver or Windows XP switch to user screens.

If we trap the error and continue things seem OK, but I
was wondering if there is anything we can do to avoid the
exception.

We are running on Excel 2002 under Windows XP SP1

Les




Leslie Spiro

Exception 0x800ac472 when accessing Excel
 
Bill,

We're writing to an existing instance, and the code is full of logic to
trap the cases in which it is not safe to write to Excel, this is just
an error code I haven't seen before.

The user screen refers to the logging in after a Switch User on XP.

Thanks for your comments

Les


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 12:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com