Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Restrict Worksheet_Calculate() to its original worksheet !!!

Hi,

I have to use worksheet calculate to fire a couple of macros.
The problem is that, at a later stage, another workbook is opened, and
worksheet_calculate() fires automatically in the newly opened workbook.
So far, I had no success in adding a trap such as :
If ActiveSheet.Name <"xxxx" Then exit sub ...
Any suggestions ???
Thanks in advance
Carim

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Restrict Worksheet_Calculate() to its original worksheet !!!

Carim,

Add this to the top of your event code:
Application.EnableEvents = False

And this to the bottom:
Application.EnableEvents = True

Of course, that may prevent the auto_open macro or the workbook_open event
of the workbook that you are opening from running, so there will be some
further testing on your part involved.

HTH,
Bernie
MS Excel MVP

"Carim" wrote in message
oups.com...
Hi,

I have to use worksheet calculate to fire a couple of macros.
The problem is that, at a later stage, another workbook is opened, and
worksheet_calculate() fires automatically in the newly opened workbook.
So far, I had no success in adding a trap such as :
If ActiveSheet.Name <"xxxx" Then exit sub ...
Any suggestions ???
Thanks in advance
Carim



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Restrict Worksheet_Calculate() to its original worksheet !!!

Hi Bernie,

It is already part of worksheet_calculate ...
As a matter of fact, the very same module tested on an empty
sheet/workbook works fine...
The problem is that a pivot table object is in this sheet, which seems
to disturb "normal behaviours" ...
Thanks for your comments
Cheers
Carim

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
Is there a way to restrict the view of a worksheet Romileyrunner1 Excel Worksheet Functions 1 October 4th 09 04:43 PM
Password Restrict a Worksheet for Viewing Annie V Setting up and Configuration of Excel 2 September 11th 08 02:52 AM
how do I restrict access to only one worksheet in excel? Avinash Excel Discussion (Misc queries) 5 March 21st 06 03:28 AM
restrict changes to worksheet EdWeitz Excel Discussion (Misc queries) 1 January 31st 05 03:41 PM
Update second worksheet with changes in original worksheet ZB Excel Worksheet Functions 0 January 26th 05 06:11 PM


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