ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Worksheet Access Denied (https://www.excelbanter.com/excel-discussion-misc-queries/34196-worksheet-access-denied.html)

Nick

Worksheet Access Denied
 
I have a program that is password protected when opened, so it can either be
opened by a password and be edited or can be opened as read-only. When the
file is opened as a read-only is there a way to deny complete access to sheet
2, but when the correct password is entered then all sheets can be viewed.
This is becasue sheet 2 has information that is only needed by certain people.

Thanks People

Dave Peterson

Not really.

I would guess that any suggestion you get would rely on macros. And macros can
be disabled by the user. So they could see anything they wanted.

On top of that worksheet/workbook protection (via tools|protection) is very
weak. It's really made to stop errors--not for security. This kind of
protection can be broken very easily.

If you have data that you don't want others to see, don't put it into excel--or
don't share that excel file with them.

Nick wrote:

I have a program that is password protected when opened, so it can either be
opened by a password and be edited or can be opened as read-only. When the
file is opened as a read-only is there a way to deny complete access to sheet
2, but when the correct password is entered then all sheets can be viewed.
This is becasue sheet 2 has information that is only needed by certain people.

Thanks People


--

Dave Peterson

Nick

Thanks Dave, I thought it was a long shot. I have written the following code
to password protect the sheet.

Dim MyStr1 As String, MyStr2 As String
MyStr2 = ("engineering")
MyStr1 = InputBox ("Password Required")
If MyStr1 = "" Then Exit Sub
If MyStr1 = MyStr2 Then
Sheets("Parts Spreadsheet").Select
Else
MsgBox "Incorrect Password"
End If

The problem with this is that the user can still access the Parts
Spreadsheet sheet by clicking the sheet at the bottom left corner of the
screen. Is there a way to stop this.

I have tried hiding the sheet but then the macro does not run as it can not
find the sheet. I'm struggling.

Can you help

Cheers


"Dave Peterson" wrote:

Not really.

I would guess that any suggestion you get would rely on macros. And macros can
be disabled by the user. So they could see anything they wanted.

On top of that worksheet/workbook protection (via tools|protection) is very
weak. It's really made to stop errors--not for security. This kind of
protection can be broken very easily.

If you have data that you don't want others to see, don't put it into excel--or
don't share that excel file with them.

Nick wrote:

I have a program that is password protected when opened, so it can either be
opened by a password and be edited or can be opened as read-only. When the
file is opened as a read-only is there a way to deny complete access to sheet
2, but when the correct password is entered then all sheets can be viewed.
This is becasue sheet 2 has information that is only needed by certain people.

Thanks People


--

Dave Peterson


Dave Peterson

How about this (still not secure, though, since it depends on macros):

rightclick on the topsecret worksheet tab, select view code and paste this in:

Option Explicit
Private Sub Worksheet_Activate()

Dim myPwd As String
Dim MyStr As String

Me.Rows.Hidden = True

myPwd = "engineering"

MyStr = InputBox("Password Required")

If MyStr = "" Then Exit Sub
If MyStr = myPwd Then
Me.Rows.Hidden = False
Else
MsgBox "Incorrect Password"
Worksheets("header").Select 'go to a different worksheet
End If

End Sub

Remember that this isn't secure. Disabling macros would stop this from even
working.

And the industrious could use formulas like:
=if(sheet2!a1="","",sheet2!a1)

and fill up a sheet with these formulas to "copy" the values out of the secret
sheet.

===
If this is really sensitive data, don't share it in excel.

(Releasing salaries, costs, prices could get you into trouble.)



Nick wrote:

Thanks Dave, I thought it was a long shot. I have written the following code
to password protect the sheet.

Dim MyStr1 As String, MyStr2 As String
MyStr2 = ("engineering")
MyStr1 = InputBox ("Password Required")
If MyStr1 = "" Then Exit Sub
If MyStr1 = MyStr2 Then
Sheets("Parts Spreadsheet").Select
Else
MsgBox "Incorrect Password"
End If

The problem with this is that the user can still access the Parts
Spreadsheet sheet by clicking the sheet at the bottom left corner of the
screen. Is there a way to stop this.

I have tried hiding the sheet but then the macro does not run as it can not
find the sheet. I'm struggling.

Can you help

Cheers

"Dave Peterson" wrote:

Not really.

I would guess that any suggestion you get would rely on macros. And macros can
be disabled by the user. So they could see anything they wanted.

On top of that worksheet/workbook protection (via tools|protection) is very
weak. It's really made to stop errors--not for security. This kind of
protection can be broken very easily.

If you have data that you don't want others to see, don't put it into excel--or
don't share that excel file with them.

Nick wrote:

I have a program that is password protected when opened, so it can either be
opened by a password and be edited or can be opened as read-only. When the
file is opened as a read-only is there a way to deny complete access to sheet
2, but when the correct password is entered then all sheets can be viewed.
This is becasue sheet 2 has information that is only needed by certain people.

Thanks People


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 04:51 PM.

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