Challenging! Create WorkBook_LostFocus event.

L

Legacy 98055

Guest
Hi all.
I have a workbook in which I want to disable the ability to copy and paste to any other workbook or application. Workbook_WindowDeactivate or Workbook_Deactivate are not fired by, for example, opening Notepad to paste. I can easily clear the clipboard, but I would like to do this via an event instead of code which would have to constantly monitor which window is currently on top. I am open to any other alternatives if there are any.
Thanks,
Tom
This message was edited by TsTom on 2002-10-19 14:02
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi TsTom,

This is perhaps in the catagory of a workaround, but why not have the workbook Activate event disable (or even remove) the Copy and Paste buttons and menu items, and also the copy and paste Ctrl-C and Ctrl-V keys? You could have the Deactivate event set them back.

Damon
 
Upvote 0
This is perhaps in the catagory of a workaround, but why not have the workbook Activate event disable (or even remove) the Copy and Paste buttons and menu items, and also the copy and paste Ctrl-C and Ctrl-V keys? You could have the Deactivate event set them back.

Howdy Tom, to follow up on Damon's suggestion, you could look at the code suggested at the following thread:

http://216.92.17.166/board/viewtopic.php?topic=14865&forum=8&1

It's not mine, I've never tested it, but the source is credible. :)
 
Upvote 0
Thanks guys.
The code is just fine. I actually did not
realize that it was that easy.
I understand that you can disable, methodically, every control, shortcut, ect...
I posted this because I have wished for events not included in Excel befortimes but can, no doubt, live without them I suppose.
Thanks.
Tom
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,876
Members
449,056
Latest member
ruhulaminappu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top