Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preserving Clipboard during / after event

Status
Not open for further replies.

tmktech

MIS
Oct 3, 2002
78
US
Howdy folks. Looking for some creative help....

I've got an Excel VBA app that has some protected / proprietary sheets and some unprotected / "user-controlled" sheets. I use activate events to protect and unprotect the workBOOK depending on the active sheet.

PROBLEM: My users can't paste into their worksheets because my events apparently clear the copy clipboard.

Let me know if I need to submit code from my events or if there's a general way to preserve the clipboard regardless
of the code.

Thanks in advance!!

TMKTECH

 
How about this. Instead of using events to protect and unprotect, on workbook_open event, use
Sheets("Sheetname").protect userinterfaceonly:=true
for each sheet that should be protected from users
This means that users cannot make changes to protected sheets but code can run unchecked. No events would be necessary after this. I know you said workBOOK protection but I don't understand why you would protect the BOOK only on certain sheets.... Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Thanks for the suggestion, xlbo, but I've got to lock the workbook to prevent the user from renaming or even deleting a system worksheet. When the user activates one of "their" worksheets, then I unlock the workbook. I just tried your code and it leaves the sheet open to rename / deletion.

TMKTECH
 
wo! - wasn't aware of that - protection of a sheet doesn't stop it being deleted???.....that's scary. I've always assumed that being as protection will not allow changes to be made, it won't let the sheet be deleted. Obviously I am wrong :(
Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top