Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Enabling/Disabling Macros w/o closing & re-opening

Hello all,

Is there a way to enable and disable macros without having to close the file and re-open it?

One of the files that my boss has designed has macros running when you switch from tab to tab, making it impossible to copy-&-paste
from sheet to sheet. I would like to be able to disable macros, do my copy & paste, and then re-enable macros without having to
close my file. Is this possible?

--
Thanks for any help anyone can provide,

Conan Kelly


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Enabling/Disabling Macros w/o closing & re-opening

What you could do would be to disable event (keeping the code from running
when you switch from tab to tab. You could then do your copying and pasting
without issue. The code to turn off events is this (which you could attach to
a button)

sub DisableEvents
application.enableevents = false
end sub

sub ReEnableEvents
application.enableevents = true
end sub

You MUST MUST MUST make sure to re-eneable events when you are finished,
otherwise events will be PERMANENTLY disabled on your machine until you run
code to switch the events back. Nothing including rebooting will not turn the
events back on. Only code.
--
HTH...

Jim Thomlinson


"Conan Kelly" wrote:

Hello all,

Is there a way to enable and disable macros without having to close the file and re-open it?

One of the files that my boss has designed has macros running when you switch from tab to tab, making it impossible to copy-&-paste
from sheet to sheet. I would like to be able to disable macros, do my copy & paste, and then re-enable macros without having to
close my file. Is this possible?

--
Thanks for any help anyone can provide,

Conan Kelly



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
Disabling formula recalculation when opening or closing workbooks Joe Excel Discussion (Misc queries) 3 August 5th 08 09:24 PM
Userforms: Disabling - Enabling the X Lauri Excel Programming 4 May 12th 06 07:02 PM
Opening a file and enabling macros automatically Fernandoalberte Excel Discussion (Misc queries) 1 June 29th 05 12:31 PM
Disabling/Enabling Macros HRobertson Excel Programming 2 October 24th 03 04:07 PM
Enabling/Disabling Macros David Excel Programming 6 August 12th 03 06:21 PM


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