Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have some VBA code that makes a menu item on the standard menu bar
appear/disappear based on whether a certain workbook (MyWorkbook) is the active workbook. Some of this code is located in the ThisWorkbook object which then calls other procedures located in Module1. For those of you that may be familiar, I'm using the code crated by Byg Software. My question is this. If I am trying to copy/paste something to/from MyWorkbook, the Workbook Activate event clears the clipboard which pretty much (well, completely) kills the procedure. Is there any way around this? Thanks, Mike. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
set some variable to the range you want to copy, like
Set MyVariable = Range("RangeToCopy") then IN the workbook.Activate, before pasting, copy (again, maybe) by MyVariable.Copy THEN paste. Bob Umlas Excel MVP "Michael Malinsky" wrote in message ups.com... I have some VBA code that makes a menu item on the standard menu bar appear/disappear based on whether a certain workbook (MyWorkbook) is the active workbook. Some of this code is located in the ThisWorkbook object which then calls other procedures located in Module1. For those of you that may be familiar, I'm using the code crated by Byg Software. My question is this. If I am trying to copy/paste something to/from MyWorkbook, the Workbook Activate event clears the clipboard which pretty much (well, completely) kills the procedure. Is there any way around this? Thanks, Mike. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You need to temporarily disable the events to keep the events from firing,
something like this (an error handler is advised with this type of code)... sub YourSub() on error goto ErrorHandler application.enableevents = false 'your code here (no events will be firing) ErrorHandler: application.enableevents = true 'events are back on end sub -- HTH... Jim Thomlinson "Michael Malinsky" wrote: I have some VBA code that makes a menu item on the standard menu bar appear/disappear based on whether a certain workbook (MyWorkbook) is the active workbook. Some of this code is located in the ThisWorkbook object which then calls other procedures located in Module1. For those of you that may be familiar, I'm using the code crated by Byg Software. My question is this. If I am trying to copy/paste something to/from MyWorkbook, the Workbook Activate event clears the clipboard which pretty much (well, completely) kills the procedure. Is there any way around this? Thanks, Mike. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet Activate Event | Excel Programming | |||
Activate / Deactivate mouse move event | Excel Programming | |||
Userform activate event question | Excel Programming | |||
Activate sheet event | Excel Programming | |||
Activate event | Excel Programming |