preventing Excel app from being emailed - excel

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.

Related

Can I protect a single Worksheet in excel to make it unviewable for other?

I have a shift planner and it can be seen/used by anyone in order to mark down their shifts. I now have created a new Worksheet that calculates how many vacation days each employee has left in order to have a better overview. Since it is law that it should not be viewed by other employees,
I thought of giving that sheet a Password. When I set the Password however, anyone can still see the contents of the sheet.
How can I set it up, so that the sheet cannot be viewed as long as the Password is not correct?
You can make that sheet "very hidden".
Steps to do:
save document as xlsm (with macros)
open the vba-editor (ALT + F11)
set the sheet to very hidden - "very hidden" means that it is not possible to unhide the sheet via the Excel-GUI (like a hidden sheet) - but only via the VBE-GUI.
To prevent users from unhiding via the VBA-Editor:
Select Extras - VBA Project properties (Eigenschaften von VBA-Projekt)
Go to the protection tab and choose to lock project plus add password.
(This protection only works if the file is stored as xlsm.)
Please be aware that there are lots of sources that explain how to crack the VBE-password. If someone wants to see the sheet he or she will be able to. An Excel-file will never be 100 % safe.

Code for the protection of worksheets - unable to be viewed without password for the specific sheet

I'm currently trying to construct a Workbook consisting of several Worksheets. However, the worksheets should be protected in a way so that they can't be opened unless the correct password is given. Ideally each worksheet should have its own password, i.e. if I were to click on say 'Sheet 2' I would have to enter a password in order to actually see the content of that sheet. I'm quite new to VBA and don't even know if this is even possible.
I have tried to solve the problem without VBA, but Excel does not have that kind of feature and only allows for the protection of cells, etc.

Excel Drop Down in Shared Mode

When I change my excel workbook to shared mode and try to copy and paste rows that have drop down lists (Data validation List), the drop down disappears.
It works fine as long as the workbook is not shared. Any solutions?
Set the Workbook to unshared, copypasta your data and then share the workbook again.
Shared workbooks are useful, regardless of their (many) limitations. In a shared workbook, you cannot:
Create an Excel table
Insert or delete blocks of cells
Delete worksheets
Merge cells or split merged cells
Add or change conditional formats
Add or change data validation
Create or change charts or PivotChart reports
Insert or change pictures or other objects
Insert or change hyperlinks
Use drawing tools
Assign, change, or remove passwords
Protect or unprotect worksheets or the workbook
Create, change, or view scenarios
Group or outline data
Insert automatic subtotals
Create data tables
Create or change PivotTable reports
Write, record, change, view, or assign macros
Change or delete array formulas
Use a data form to add new data
Work with XML data
Before you unshare the workbook, ensure no-one else is using it by clicking Share Workbook in the Changes group on the Review tab.
Select the name of the user who you want to disconnect, and then click Remove User.
Shared workbooks have severe limitations. Some functionality is disabled in shared workbooks. Other stuff just slowly starts to fall apart.
Consensus amongst Excel experts is that shared workbooks should be avoided, because it's not a quesiton of IF but WHEN they will become corrupt. Shared workbooks are impossible to troubleshoot.
Yes, Excel offers the feature, but it was never designed for simultaneous multi-user write access to a data set. If you need that functionality, you'd be better off with a database like Access or SQL.
Don't shoot the messenger.
I had similar issue and searched to find that there is no scope to add drop-down to the shared workbook. I got my work done by simply removing share option in the workbook, applied desired changes and shared the workbook again. :)

Protect Excel Slicers

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.

Saving individual sheet in Excel VBA

Currently we have a Excel VBA application, which consists of 25-30 Excel sheet (and all of those sheets all hidden and we do background processing on them and display it to VBA forms UI), and we have developed a UI using VB forms. But problem we are facing is whenever we click on Save button using this code:
ThisWorkbook.Save
But this saves entire workbook not an individual sheet, so even if we make changes in single sheet it saves entire workbook and this save processing makes very slow (since it needs to save all excel sheet containing lot of data unnecessary, even if there is no changes).
My question is is there any way we can save "only one sheet in a particular excel sheet" not an entire excel file?
Note: I am a Java developer and I worked on VBA before, But it was years back, and I have forgotten bit. Any guidance would be appreciated. Or any pointers on how to handle this situation would be appreciated. Please let me know if you need any more information, I can edit this question.
What I have tried already? I did a lot of research from yesterday, I searched in previous questions on SO, but didn't get any useful information. As per my research it says we cannot do this. Am I on right path?
The short answer is no. You cannot save a single worksheet at a time.
You may want to try to reduce the amount of data in the workbook. Try storing data in several workbooks and when it is needed, open that specific workbook, make the needed changes, and then close it.
If it is necessary to have access to all data at once then consider using access or some other database.
It is also possible that the sheets have "blank data". Cells that don't contain anything in them but excel thinks they do so when saving it tries to save way more than needed.
Assuming that it is the active worksheet that you want to save then you could do something like this:
ActiveSheet.Copy
ActiveWorkbook.Close True, "path"
This copies the active worksheet which creates a new workbook which will become the active workbook. Then just call the close method on that and give it a file name.
I think you should consider splitting your application into multiple workbooks:
The workbook that contains all the logic, user forms and programming code. This workbook handles all other workbooks as well as the displaying of it. Potentially, this could be even an "Application Specific Addin", that stays dormant but activates as soon as any of it's subsequent workbooks gets opened. For this architecture approach check out the section on "Application Specific Addins" in this link.
This workobook/add-in can also hide the other workbooks, so that the user will not notice it's multiple workbooks.
One or multiple data workbooks: Depending how interlinked the data is, you can separate this, e.g. in a "Sales data" workbook which contains the large database, as "Base data" workbook, that contains all the smaller data (e.g. products or stores tables).
This way, you can reduce the saving to the "relevant" sheets. However, of course this requires quite a bit of reprogramming - but it's worth the effort, as for instance it also allows to provide updates/bug fixes without having the transfer the data between versions, as you only need to distribute the the file with programming logic. :-)

Resources