PDA

View Full Version : DISABLE PASTE INTO ANTOHER WORKBOOK



ASHU SONI
08-19-2015, 01:33 AM
I HAVE A WORKBOOK THAT CONTAIN DATA THAT WE NEED TO COPY FROM ON SHEET TO ANOTHER BUT FOR SECURITY REASON I WANT TO PROTECT MY WORK BOOK

I WANT COPY PASTE WORKS ONLY IN MY WORKBOOK UNTIL IT'S OPEN
NO BODY CAN COPY DATA AND PASTE INTO ANOTHER WORKBOOK
WHEN SOMEONE TRY TO COPY AND PASTE DATA INTO ANOTHER WORKBOOK PASTE OPTION SHOULD BE DISABLED BUT PASTE OPTION WORKS ONLY IN MY WORKBOOK

PLEASE HELP ME WITH SOME SPECIAL CODES

SamT
08-19-2015, 06:57 AM
Stop yelling, it's impolite.

In the ThisWorkbook Module


Private Sub Workbook_Deactivate()
Application.CutCopyMode = False
End Sub

ASHU SONI
08-21-2015, 07:41 AM
SIR YOU STILL DON'T UNDERSTAND MY PROBLEM
I HAVE 2 WORK SHEET 1 IS DATA AND 2 ONE IS INVOICE , DATA WILL BE COPY FROM DATA SHEET AND PASTE ON INVOICE SHEET[ I WANT YOU TO GIVE ME CODE IF I OPEN ANOTHER WORKBOOK DATA WILL NOT BE PASTE ON ANOTHER WORKBOOK ]
IN SHORT - COPY PASTE WORK IN SINGLE WORKBOOK IF ANOTHER WORKBOOK OPEN PASTE OPTION WILL BE DISABLE ]
I HOPE YOU UNDERSTAND MY PROBLEM

SamT
08-21-2015, 08:44 AM
Sir, I will not respond to you again until you stop yelling at me.

POSTING IN ALL CAPITOL LETTERS IS YELLING!

ASHU SONI
08-22-2015, 02:24 AM
sorry sir is did't know about capitol letter is yelling
i read faq
please help
my problem is about copy paste [ suppose 2 workbook is open one is "office" and other one is "software" copy paste should only work in software workbook if someone copy data from "software workbook should not be paste on "office" workbook but paste option work's in "software" workbook ]
sir please help
i did not wanted to disobey you

SamT
08-22-2015, 07:39 AM
Thank you sir,

With Workbook "Software", Open the VBA Editor. Press CTRL+R to insure the Project Explorer Widow is open.

In the Project Explorer Window Expand, (Click the +,) "VBAProject (Software)" and "Microsoft Excel Objects."

Double click "ThisWorkbook" under Microsoft Excel Objects. This will Open the Code Page for the Software Workbook.

In that Code Page, Paste this code:

Private Sub Workbook_Deactivate()
Application.CutCopyMode = False
End Sub
If anything in Software is copied, when they Activate, (click on, or Open,) another Workbook, this code will clear the Clipboard and there will be no Paste Option.

They can still Copy and Paste inside the Software book.
They cannot Copy inside Software and Paste into any other book
They can Copy and Paste inside the Office book
They can Copy inside Office and Paste into the Software book.

Please let my know if you need more functions.

mikerickson
08-22-2015, 09:26 AM
"for security reasons"

If security is an issue, do not use Excel.
It is not a secure platform.
If anyone with moderate knowledge of Excel wants to get your information, they can bypass your protections easily. (Any excel protections)

If security is important, Excel is the wrong platform for you.

SamT
08-22-2015, 09:37 AM
Mike,

Note the specificity of my comments in my last post.

mikerickson
08-22-2015, 09:59 AM
Sam, you know the limitations of Excel.
I'm just trying (probably futiley) to save the OP some time, by getting them to give up on making workbook data secure. (Protection against thumb fingered users is one thing, protection against bad guys is futile).

My guess is that either the OP (or more likely their boss) will spend many hours trying to keep the bad guys out unless they are told that that effort is doomed.

SamT
08-22-2015, 10:26 AM
I got the impression that the OP has some barely trained Users he is trying to prevent something that one of them inadvertently managed to do.

Aussiebear
08-22-2015, 02:33 PM
Nowhere in the posts above has the OP given any such hint Sam, and yes while your code will do as you say, Mike's comments are well justified. Excel is simply not the platform if you need protection.

SamT
08-22-2015, 03:26 PM
[QUOTE=Aussiebear;329841 Excel is simply not the platform if you need protection.[/QUOTE]

Yes. Well...