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 BeforeClose vs Auto_Close

I have a nagging issue. I am trying to run a BeforeClose sub but it
just won't go. However, if I replace it with the Auto_Close sub then it
works fine. The code is simple:

private Sub Workbook_BeforeClose(Cancel As Boolean)
MsgBox "close macro is working"
end sub

With the above code I do not see my message box when I close my
workbook. It just closes.

private sub auto_close ()
MsgBox "close macro is working"
end sub

With the above code I get my messagebox (and the useful bits of the
code which I haven't pasted in here). I read something about the need
for events to be enabled, so I ran a macro to enable events
(Application.EnableEvents = True), but to no avail.

It's not a big issue because the Auto_Close does what I need, but as a
fickle follower of fashion I feel out of date. I've read that
Auto_Close is soooooo last centuary ;-). What could I be doing wrong
that stops the beforeclose working but lets auto_close do its job?

regards Ben

 
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
question about Auto_Close and WorkbookBeforeClose Brian Murphy Excel Programming 8 October 9th 04 08:08 PM
Question about auto_close Neil[_20_] Excel Programming 3 July 7th 04 09:24 PM
BeforeClose, Auto_Close, and ActiveX Server Don Wiss Excel Programming 0 November 21st 03 12:21 AM
Auto_Close() needs help Phil Hageman[_3_] Excel Programming 3 November 19th 03 05:56 PM
Auto_Close Luc Benninger Excel Programming 2 October 14th 03 12:34 PM


All times are GMT +1. The time now is 01:48 PM.

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"