ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protecting a worksheet from veiwing but not from importing in data (https://www.excelbanter.com/excel-programming/271247-protecting-worksheet-veiwing-but-not-importing-data.html)

Jimmy Ho

Protecting a worksheet from veiwing but not from importing in data
 
What is the best way to have a worksheet protected from
viewing but still allow users to transfer information from
a second worksheet into the protected one?

We have mutliple users that would save information into a
worksheet, but the viewing of the information contained in
the worksheet has to be limited to a select few. How can
this be done?

Thanks

Greg Wilson[_2_]

Protecting a worksheet from veiwing but not from importing in data
 
The following code run from a code module will hide the specified sheet.
The user can't even tell it exists. To unhide substitute True in place
of xlVeryHidden. You can then lock the VBPoject to protect anyone from
running the code to unhide.

Transfer of information to the hidden worksheet can still be done by
code; e.g., a "Save" button that the user presses to store the data to
the hidden sheet. The button must invoke a macro that tells it to
transfer the data of course.

Sub HideSheet()
Sheets("Data").Visible = xlVeryHidden 'True to unhide
End Sub

Regards,
Greg




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Harlan Grove

Protecting a worksheet from veiwing but not from importing in data
 
"Greg Wilson" wrote...
The following code run from a code module will hide the specified sheet.
The user can't even tell it exists. To unhide substitute True in place
of xlVeryHidden. You can then lock the VBPoject to protect anyone from
running the code to unhide.

....

Classic example of what's good enough to prevent unknowledgeable, innocent
users from sinding this worksheet vs preventing anyone who knows what s/he's
doing from stripping anything useful or interesting out of a file.

The following macro run from another workbook happily lists the names of all
very hidden worksheets in the target workbook security_test.xls.

Sub foo()
Dim x As Worksheet
For Each x In Workbooks("security_test.xls").Worksheets
If x.Visible = xlSheetVeryHidden Then _
MsgBox x.Name & Chr(13) & "is 'very hidden'"
Next x
End Sub

The INESCAPABLE point is (and seems to be repeated daily in one ng or
another): .XLS files ARE NOT SECURE! The best that the built-in security
features can do is prevent INADVERTENT tampering. Against determined
assault, Excel's security features are as sturdy as a house made out of wet
toilet paper.




All times are GMT +1. The time now is 01:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com