LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Problem with Workbook_BeforeClose event

Hi all.

I am having trouble figuring out a strange behavior with the
Workbook_BeforeClose event procedure.

Suppose I have a Workbook_BeforeClose event procedure that makes some
changes to some worksheets and then save the workbook before closing.
The changes made by the event procedure would be saved only if the
workbook is closed manually in Excel by a user.

However, if the workbook is opened and then closed by an external VB
program using Excel application object, changes made by the
Workbook_BeforeClose event procedure are NOT saved. In fact, the
modification date/time of the Workbook file remains unchanged.

To make sure the Workbook_BeforeClose ran if the workbook was closed
by the external program, I placed several MsgBox statements in the
Workbook_BeforeClose event procedure. And sure enough all the MsgBox
messages were displayed, but changes were not saved.

Does anyone know what is going on here with the Workbook_BeforeClose
event?

Thanks.
Jason

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Workbook_BeforeClose event and OnTime method Bejaz Excel Programming 3 September 5th 05 03:04 AM
Workbook_BeforeClose event is not canceled Mircea Pleteriu[_2_] Excel Programming 1 June 8th 05 08:47 AM
Detecting a cancel on Workbook_BeforeClose event? Don Wiss Excel Programming 3 January 18th 05 12:49 PM
Workbook_Beforeclose vs BeforeClose Event Juan Pablo González Excel Programming 3 February 2nd 04 12:17 AM
Workbook_BeforeClose Event Shatin Excel Programming 2 January 24th 04 03:50 AM


All times are GMT +1. The time now is 02:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"