View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
ARHangel ARHangel is offline
external usenet poster
 
Posts: 24
Default SaveAsCopy generates error HRESULT:0x800A03EC

Perhaps I forgot to tell that my excel is an embeded object so the FileOpen
is out of the question since it does not exist.

And the other one that not to run the code if the user is editing is also
out of the question.

The reason I am doing SaveAsCopy is to create a backup for my file, because
autorecovery does not work for embeded objects.
Apperently this exception apperas only if I edit the excel embeded, and not
if I edit it in MS Excel the exception is not raised.


"NickHK" wrote:

Forcing the user out of edit mode, so your code can run, is IMHO a very bad
idea. If I have spent the last 10 minutes typing in a complex formula, only
to have it all wiped out, you addin would not be on my system long.
Your code should check if in Edit Mode and if so, not run.

MS has suggested Application.Ready, but most say this does not function as
supposed.
An alternative is to check if the FileOpen menu option is enabled or not.

NickHK

"ARHangel" wrote in message
...
I attach to Excel Application event WorkbookActivate a method in witch I

call
SaveAsCopy. I have search the internet and I found that this error ocurrs
because a cell is in edit mode. So my question is how can I end edit of

the
cell so this error will not ocurr again.