I need to disable the copy/paste in excel 2007. The excel file will be sent to different users so i need a solution where copy/paste is disabled for all users.
I have searched the web but everyone has asked to enable the macros but the problem with that is i will have to enable the macros for every user first before restricting them from copy/pasting.
So looking for a solution where i can write some vba code on sheet to restrict all users from copy/pasting without enabling macros.
Thanks.
Lock the Cells with the Protection Option of Excel manually or lock them programmatically.
Example:
'Range Lock
Worksheets("Sheet1").Range("A1:G37").Locked = True
'Sheet Lock
Worksheets("Sheet1").Protect
EDIT:
Just saw ur new comment, there is no option to use VBA code to block ONLY copy/pasting without allowing Macros in ur Workbook.
You don't need VBA for this.
Go to the review tab
Select protect sheet
Protect with password and take away the ✓ (there should only be one)
Related
I'm setting up a shared Excel spreadsheet with macros, but I don't want to let anyone edit the document at all until they've clicked the "Enable Content" in the SECURITY WARNING bar at the top.
How can I "protect" the workbook like that?
Set up the workbook to run a macro before the file is saved (workbook.beforesave). In that routine, set all sheets to xlVeryHidden, except for one sheet where you explain that the user needs to enable macros. You could even have a screenshot showing what they need to click.
When macros are enabled, the workbook_open event can unhide all sheets you want to show.
Protect the VBA project with a password.
Someone with very malicious intent and advanced coding skills will probably be able to find a way to circumvent this setup, but it should work well in a business environment where people just want to get their work done.
I have a workbook I have created with lots of different formula's. My question is, how can I stop the end user from stealing the formula's? I have had a look at: Protecting Code in an Excel Workbook?
This is generally for VBA. Is there a way to stop users doing this, or is it just worksheet protect and cross your fingers?
You probably should be more specific on what formulas are you trying to protect: Excel Worksheet formulas of the VBA code?
In general, you can create a custom VBA Add-in (i.e. .xla file) and protect it with password as per Excel documentation. In case your major concerns relate to worksheet function, then you can include them in said VBA add-in using for example, Range.Formula (re: https://msdn.microsoft.com/en-us/vba/excel-vba/articles/range-formula-property-excel ) or Range.FormulaArray properties.
Hope this may help.
There is no way to fully protect formulas in Excel. For every password protection type, there is a way to break that protection. The only thing you could do if you really wanted to prevent end-users from getting the formulas is to hard-code the entire sheet before sending it to them. Of course, if the workbook relies on user input and using formulas to output an answer, that won't work.
Do you need the formulas protected for some sort of IP reason, or just to prevent people from messing them up?
I have a excel file that I need to give to a client. It currently comprises of one worksheet but could easily have many more. On the sheet there is a graph and a selection of slicers.
The problem I have is that if I hand this over to the client, they'll see the underlying code and possibly not need our services going forward.
How do I protect the sheet/file and only allow them to view data and operate the slices without seeing any of the background workings?
They must not be able to save a copy, access the SQL code or save changes.
Thanks,
JJ
You can bolt down excel with the protection options so that people can't edit objects and can only select non-locked items. You can also password protect vba and force read-only open of the spreadsheet.
http://office.microsoft.com/en-gb/excel-help/password-protect-worksheet-or-workbook-elements-HP010078580.aspx
There are lots of protection options available but the best thing you can do is reference a report/webpage with the data on instead of doing a direct db connection. This will alleviate a lot of security risks whilst also blackboxing your database.
IMHO
Only lock your spreadsheet down enough to prevent silly mistakes - combined with your data being a blackbox, they will get a usable spreadsheet and be much happier with you than if they felt you were aggresively trying to withold stuff from them. They may run off with your spreadsheet but the extension of trust to them will help discourage the behaviour and at the end of the day, if someone wants to really harvest your IP, they will do so no matter how many controls you have in place.
you also can try to protect VBAProject at the VBA window, something like this:
and put a password
this way the user can manipulate the worksheet without seeing your code, additional to this, block your worksheet like #StephLocke saids.
Your Workbooks can always be vulnerable, but you can lessen the risk to corrupt your code.
PS. My Excel is Spanish but the options are at the same place.
It is possible to protect the worksheets and still allow to interact with the slicers (and only the slicers).
Set each slicer's properties to not "Locked" by right clicking the slicer and selecting "Size and Properties..." and unsetting the "Locked" property.
Protect all other worksheet elements including cells and Pivot Charts in a similar fashion (set their "Locked" property).
Finally, protect the worksheet via “Review” -> “Protect Sheet” and select "Use AutoFilter" as the only action in the selection "allow for all users of this worksheet to".
You might also confer to this answer.
I have employees that use a macro/external data enabled Excel file. One of the worksheets in this file contains proprietary data, that is populated from an external data source ODBC connection. This proprietary worksheet is always hidden from the user, because it just serves as a Vlookup-function data-source
I want to prevent my employees from accidentally emailing this Excel file, because I don’t want the hidden worksheet data to be available to non-employees
Please advise if there is anything I can do prevent the email recipient from being able to view the data that is in the hidden worksheet, if the app is accidentally emailed to them.
Are any of the following ideas feasible?:
Password protecting the hidden worksheet, yet, not preventing the Vlookup function from the other worksheet from functioning?
Imbedding something into the app that resembles a virus, to cause all email servers to block the attachment.
Creating a macro that deletes the data from the hidden worksheet when the app is closed
Imbedding large images into the app to make it too large to email, but yet won’t affect the performance.
Please advise, thank you very much in advance, Nathaniel
In regards to number 3, there is a setting like this in the Connection Properties. It's "Remove Data from the external data range before saving the workbook." I'm not looking at XL 2003, but it's nested under the "Refresh Data When Opening the File" option. As others have said, this isn't foolproof, but it might help meet your requirements.
I don't think you can fundamentally prevent your workbook to be sent around. Password-protecting the sheet would be of little help, as it is fairly easy to bypass. The safest approach to protect your proprietary data from prying eyes would be to not have it in the worksheet itself, retrieve it dynamically by prompting the user for some credentials, and never save it in a worksheet.
You can hide the sheet from the developer tab of excel. To do this, follow the steps below
Open the excel
Press Alt + F11
Here you can see the list of sheets on your excel file
Select the sheet that you want to hide
When you select the sheet you can see the properties of the particular sheet below
Set the visibility property to ‘2 – xlSheetVeryHidden’
Now right click on the sheet and select VBAProject – Project Properties
Navigate to the Protection tab and check ‘Lock project for viewing’
Set a password
Sheets hidden in this way cannot be un hidden unless one has access to the VBA Project (but this is now password protected). The sheet can be seen only if you know the password.
I have created a spreadsheet for work and am trying to protect the sheet so that nobody except myself can edit the document. I have set it up so that I can edit the full range of the document. In the protection setting I have ticked the box that says that any users can use auto-filter.
I have the auto-filter set before applying the security so this is not the issue as many forums would suggest. However I am using Excel 2003 whereas the majority of the organization is using Office 2000. I can't help thinking that there is some incompatibility between the two systems. Can anyone advise? VBA macro's aren't really an option as the default setting within the organization is that only signed macros can run but even then they have to be verified by the end user (very annoying for users with a low IT knowledge).
Does anyone know of a way to make this work?
Does the organisation allow to change the default security settings within Excel for yourself and your users?
If not you can easily create your own macro signature. I think its an optional install component to Excel that allows you to create the signature based on your PC or username? This will not have the same standing as a full Microsoft verified signature but depending on the organisation's settings it might allow all your macros to be accepted.
This worked for me a few years ago on Excel 2000 but I still had to have each user change their security settings. I think I also made a macro to automate this change in security settings for each user? If I remember correctly.
This is solved now. we are all working on Office 2010.
It's not possible without VBA. See http://office.microsoft.com/en-us/excel-help/enable-autofilter-functionality-for-a-protected-worksheet-HA001098270.aspx
By default, the AutoFilter functionality in Excel becomes unavailable when you protect part or all of a spreadsheet. If you use Microsoft Office Excel 2003 or Excel 2002, you can restore that functionality manually. If you use Excel 2000, you need to use a few lines of Microsoft Visual Basic® for Applications (VBA) code.
Use VBA code to protect a worksheet and enable the AutoFilter
functionality in Excel 2000
The sample code shown here protects a worksheet (not a workbook) and
enables the AutoFilter functionality for that worksheet. The code
works only with Excel 2000. This particular sample runs automatically
when you open the workbook that contains the protected worksheet. The
code also contains a password that you use to unprotect the worksheet.
If you haven't already, start Excel 2000, open the desired workbook, and note the name of the worksheet that you want to protect.
On the Tools menu, point to Macro, and then click Visual Basic Editor.
In the Project Explorer, double-click ThisWorkbook.
A new, blank code module opens in the code window.
Copy the following sample code and paste it into the code window:
Private Sub Workbook_Open()
Sheet1.Protect password:="test", DrawingObjects:=True, _
contents:=True, Scenarios:=True, _
userinterfaceonly:=True
Sheet1.EnableAutoFilter = True End Sub