#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Stop Event

I have written a workbook_beforeclose procedure that checks if data had been
entered into a cell. At times, I do not want it to run when I close the
workbook. So I create a button with a simple code of "Application.Quit",
hoping that it would bypass the workbook_beforeclose. But it does not work.
Can anyone tell me how to by workbook_beforeclose procedure when I close the
workbook?
--
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Stop Event

Create a non-Event macro to simply disable events. Run this macro and then
close
--
Gary's Student
gsnu200706


"Daviv" wrote:

I have written a workbook_beforeclose procedure that checks if data had been
entered into a cell. At times, I do not want it to run when I close the
workbook. So I create a button with a simple code of "Application.Quit",
hoping that it would bypass the workbook_beforeclose. But it does not work.
Can anyone tell me how to by workbook_beforeclose procedure when I close the
workbook?
--
Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Stop Event

Sub Disable()
Application.EnableEvents = False
End Sub


Gord Dibben MS Excel MVP

On Thu, 15 Feb 2007 10:52:20 -0800, Daviv
wrote:

I have written a workbook_beforeclose procedure that checks if data had been
entered into a cell. At times, I do not want it to run when I close the
workbook. So I create a button with a simple code of "Application.Quit",
hoping that it would bypass the workbook_beforeclose. But it does not work.
Can anyone tell me how to by workbook_beforeclose procedure when I close the
workbook?


Reply
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
Stop the _Change event? Is there EnableEvents for Forms? T_o_n_y Excel Programming 3 January 21st 07 09:39 PM
Stop Capture Event OverAC[_19_] Excel Programming 4 April 11th 06 02:08 PM
Stop Worksheet_SelectionChange event from firing? Ed Excel Programming 13 January 5th 05 12:57 PM
How does msgbox stop the OnTime event? Emile van Mierlo Excel Programming 12 May 4th 04 01:10 PM


All times are GMT +1. The time now is 07:57 AM.

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

About Us

"It's about Microsoft Excel"