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

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Damon Ostrander

MrExcel MVP
Joined
Feb 17, 2002
Messages
4,239
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
 

NateO

Legend
Joined
Feb 17, 2002
Messages
9,700
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. :)
 
L

Legacy 98055

Guest
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
 

Forum statistics

Threads
1,144,255
Messages
5,723,280
Members
422,490
Latest member
Lyone01

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
Top