View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Ed[_9_] Ed[_9_] is offline
external usenet poster
 
Posts: 194
Default File|Close w/Save fires Workbook_Open twice

I'm still very new to VBA, so I don't have any ready answers. But I have an
idea - and I hope it's valid! What I would do in this case is to code both
the "File|Close (accept save)" and "File|Save (wait for it to finish); then
File|Close" commands into modules, then step through it with the debugger.
Maybe then you could catch the point in the Close or Save procedures at
which it triggers a re-open. Like I said, I'm green, and this may not be too
valid - you sound like you're a better judge of that than me. I just
thought that having it all in code so you could watch what's happening at
every step might give some clues.

Ed

"Mike Preston" wrote in message
...
Anybody else have any ideas or does my "the file may be partially
corrupted" have some merit?

Thanks

mike

On Thu, 28 Aug 2003 14:16:30 GMT, (Mike
Preston) wrote:

As you mentioned, this is a protection scheme, so if a user opens the
workbook without enabling macros, the intent is to have only one
worksheet visible, with a message that tells the user to close down
the workbook and reopen it, this time enabling macros.

When the workbook is opened with macros disabled, it also works as
expected. That is, only one worksheet is visible and the other "real"
worksheets are as hidden as I can make them (xlSheetVeryHidden).
And, when the one worksheet is slightly changed (just moving the
selected cell) and then exited with [File|Close (accept save)], it
exits as expected (the Workbook_Open sub does not fire twice).

I'm beginning to think I need to copy the sheets, one by one, to
another workbook as maybe this one is slightly corrupted.

Thanks again.

mike