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

My code is an excel add-in. And yes the menus of the excel embeded in a word
appear but the menu File belongs to the word and not to the excel.

And like a said I want to replace the autorecovery. And since the
autorecovery is triggered even if the user is editing the excel, i thought
that there is a way of suspending the editing of the file while I save a copy.

Thank you for answering me but apperently in an embeded object since the
menu File is not available also the methods of the menu are not woking right.
So the container of the excel will have to create my backup file.

"NickHK" wrote:

So your code is VBA in the embedded workbook ?
Or the code is in an Excel addin ?

Either way, when I activate the Excel WB (embedded in a Word doc), I get the
Excel menus showing. Maybe check the status of the ViewFormula bar menu
item ?
Otherwise explain you set up a bit more.

NickHK

"ARHangel" wrote in message
...
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.