I need to prevent editing, copying and selecting cells in worksheet, but there should be a possibility to change width and height of rows and columns. I can do this using Excel Application by choosing different protection options but i cannot find anything like this in java libraries.
I mean I can set password to make document read-only but user still can copy information and change it. I need a tool which will allow to change protection properties of worksheet programmatically.
Is there anything like this in such libraries as apache poi or jxl? if not is there any library which can do it (much better if it will be free-to-use)?
Thanks for your replies and sorry for my english :)
to make your excel-sheet protected do this:
sheet.getSettings().setProtected(true);
and to password-protect your sheets-individually do this:
sheet.getSettings().setPassword("password");
but...i've seen that password doesnt work..
Related
it sounds simple but I am struggling
Do you know how to password protect a single sheet (there’s multiple sheets in the work book) so that you can only view it with a password. So the user can’t see it with the ‘read only’ option, I can only seem to be able to do it to the whole workbook. But just need it for 1 sheet only?
Thanks
A visually undiscoverable and password-protected sheet. C4 has test, but you can't see it. I also removed gridlines for grins.
I thought about this for a bit, and here's my best answer:
Change the cell and font colors to be the same
Protect the sheet and disable the ability to change ANYTHING.
Hide the sheet, if necessary.
This would force someone to:
Have the password.
Select All fields on that page, and then change the font color.
If memory serves correctly, this can easily be hacked by importing the workbook to Google Sheets, converting it to a Sheet, and then re-exporting it back to XLSX. In other words, don't be trying to hide anything TOO sensitive here.
I could not find an answer to this, neither on Stack or on the wild web. I have a sheet where I need users to be able to use Text to Columns, however, I also need to protect the sheet. Everything works fine if Excel automatically does this (from Text to Column "short-term memory"), but I cannot access the option when protection is enabled.
It is not that any text is spilling onto locked cells, it's just that the option is greyed out after protecting the sheet. I would appreciate a non-VBA answer as I do not want to use macros on a shared file (the server is extremely slow and even normal excels take ages to save). However, if absolutely necessary, can you ninjas please tell me how I can set it up so that this problem is solved with the least possible performance hit?
P.S.: I am pretty new to VBA (practically uninitiated, I prefer R for everything). Also, the shared server is basically a network folder, so it is not likely that it will cause any issues other than being super-sloth.
If you protect a sheet, then only unlocked cells can be edited, that is, users can change the cell manually.
That is the core and purpose of sheet protection.
In a protected sheet you will not be able to perform a text to columns manually.
Whether or not the file lives on a server is totally unrelated to using VBA for a solution.
The real question is: What are you trying to achieve? Your question is about running Text to Columns on a protected sheet, but if you step back from that particular approach, there may be other ways to achieve what you really need to do.
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'm currently building a VBA based application on Microsoft Excel.
I used simple activeX control to get the user ID/password. The problem with this is that the user might be able to view the password's value by viewing the "properties" of the activeX label
Is there any way that I can prevent the user from activating the "Design" mode and seeing the values of the textboxes directly? Or is there any better way to store the credentials on the system? The reason why I use the textboxes is because they are simpler for the user to use (you can save the value and hence you can use the program in the future without the need to retype the userid/password again) and it's simple to maintain (no need forms/popups)
Thank you for your help.
This is how the id/password box on the sheet look like (using activeX control)
The problem is that the user can see the value of the password textbox if they open the design mode -> properties
I would create a UserForm to handle the username/password system. The form could save the username and password to a very hidden sheet by setting the 'Visible' property for the sheet to 'xlSheetVeryHidden' in the VBA IDE. The sheet can't be unhidden unless you go into the VBA IDE and change the visible property.
When the form is opened, load the data from two ranges on that sheet. You can set the range names to be hidden from the Name Manager in case you are concerned about users working out the range names and putting the value into a cell.
The only people who would know what the cell range names are, and where to access them, would be those with access to the VBA code. So protect that with a password and it will be as secure as you can make it in Excel, well at least in my view.
Security is a relative thing in any case. How secure something needs to be depends on how important the data is. If it is just to keep people from messing with things they shouldn't then simple security is fine. If it is highly confidential data then you shouldn't be allowing users to save a password anyway. A username perhaps, but not a password.
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.