LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Enable/Disable Worksheet Change Event code

Thanks for that. I see the need for caution.

The only thing I could think of was to have the menu
item load the event code into the ThisWorkbook
module of their chosen workbook, and then delete it
when the workbook is closed or saved, etc.

Might this be a safer way?

Regards.

"Nick Hodge" wrote in message
...
Stuart

I suspect you want the follwing line, but use it with caution as any

errors
in the code could leave Excel with events turned of

Application.EnableEvents=True 'Switches events on

You can put the reverse

Application.EnableEvents=False

In the workbook_open event to turn them off each time the workbook is
opened.

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS



Stuart wrote:
I have worksheet_change event code stored in an addin.
The addin's routines are accessed via a series of menu items.

The event code is designed to track changes in Col B while
the user creates their workbook, or later returns to modify it.

Is there a way via a menu item to enable/disable the event
code, please?

So, the user would open a workbook and the event code
would be disabled. If the user wanted, they would select the
menu item to enable the event code (for that workbook only),
but when that workbook was closed/saved, then the event
code would be disabled by default.

Any help much appreciated.

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.535 / Virus Database: 330 - Release Date: 01/11/2003Stuart





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.535 / Virus Database: 330 - Release Date: 01/11/2003


 
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
Worksheet Event Code chequer - ExcelForums.com Excel Worksheet Functions 0 November 10th 04 06:30 AM
Disable Change Event in Form No Name Excel Programming 5 October 31st 03 08:23 PM
Copy Sheets minus Worksheet Change Event code & Macro Buttons Bob[_36_] Excel Programming 0 October 8th 03 01:17 AM
Excel 2000 ComboBox Code Change event Matt. Excel Programming 3 July 28th 03 03:29 PM
Disable Worksheet change event Tim[_14_] Excel Programming 4 July 15th 03 01:27 AM


All times are GMT +1. The time now is 01:16 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"