+ Reply to Thread
Results 1 to 4 of 4

Worksheet Access Denied

  1. #1
    Nick
    Guest

    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

  2. #2
    Dave Peterson
    Guest

    Re: Worksheet Access Denied

    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

  3. #3
    Nick
    Guest

    Re: Worksheet Access Denied

    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
    >


  4. #4
    Dave Peterson
    Guest

    Re: Worksheet Access Denied

    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1