View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default File|Close w/Save fires Workbook_Open twice

Do you have a

ThisWorkbook.Close SaveChanges:=True
in your BeforeSave code?

Post your BeforeSave code.

--
Regards,
Tom Ogilvy



"Mike Preston" wrote in message
...
Excel 97.

I have a small module in Workbook_Open() in the ThisWorkbook area.
Otherwise there are maybe 100 lines of code spread between 1 worksheet
module and a regular module. When I save the Excel workbook by
File|Close, and then answer YES, the code that I have in
Workbook_BeforeSave is executed, the file is saved and then it
re-opens and executes Workbook_Open. I have a simple msgbox prompt in
the Workbook_Open sub and it fires when I open the workbook and then
again when I close it with File|Close. If I do a File|Save and then
close Excel, everything happens as it should.

Has anybody run into this before? Can I provide any more information
to help you tell me what I might be doing wrong?

Thanks

mike