Please can somebody help me? I have a macro which requires a user to provide a password before they can unhide some sheets in a file. The workbook is protected and they must provide the password to unprotect it and then unhide the sheets. The macro works fine on my PC, but when somebody else uses it, they can enter any password and it will allow them view the sheets. Why is this. Please help. My code is:
Public Sub UnprotectandUnhide()
Dim Pass As String
Dim Sicktime
Pass = InputBox("Please enter password to unhide sheets")
Sicktime = Range("B10").Value
On Error GoTo ErrorHandler
ActiveWorkbook.Unprotect Pass
If Sicktime >= "37622" Then H2003 Else If Sicktime >= "37257" Then H2002 Else If Sicktime >= "36892" Then H2001 Else End
If Sicktime >= "37257" Then H2002 Else If Sicktime >= "36892" Then H2001 Else End
If Sicktime >= "36892" Then H2001 Else End
Exit Sub
ErrorHandler:
MsgBox "Wrong password, please re-enter"
On Error GoTo 0
End Sub
Please help. The other PC does have macros enabled...
This message was edited by y2k on 2002-03-19 08:21
Public Sub UnprotectandUnhide()
Dim Pass As String
Dim Sicktime
Pass = InputBox("Please enter password to unhide sheets")
Sicktime = Range("B10").Value
On Error GoTo ErrorHandler
ActiveWorkbook.Unprotect Pass
If Sicktime >= "37622" Then H2003 Else If Sicktime >= "37257" Then H2002 Else If Sicktime >= "36892" Then H2001 Else End
If Sicktime >= "37257" Then H2002 Else If Sicktime >= "36892" Then H2001 Else End
If Sicktime >= "36892" Then H2001 Else End
Exit Sub
ErrorHandler:
MsgBox "Wrong password, please re-enter"
On Error GoTo 0
End Sub
Please help. The other PC does have macros enabled...
This message was edited by y2k on 2002-03-19 08:21