PDA

View Full Version : Question on creating a shared spreadsheet with user login and password



ishwar001
10-17-2011, 11:35 AM
I am brand new to VB , i know very little basic of VB from you tube.. please please help..

I am trying to create a spread sheet with user logon id and password to open the sheet2.
I managed to find a VB code from allexperts website, however i have an error which i am not able to decode ( since i have no idea of whats wrong) more details bellow

i am using
MS office 2007 ( in ubuntu - wine)

The code i am using is ( slightly modified to my work sheet needs) please have a look and the error msg will follow the code

Sub checkPassword()
Dim strUserName As String
strUserName = ActiveSheet.Range("B2")
If Application.VLookup(strUserName, Range("a1:b1"), 2, 0) = _
ActiveSheet.Range("B3") Then
Sheets("Sheet2").Unprotect
Sheets("Sheet2").Visible = True
Else
MsgBox "Name/PW rejected"
End If
End Sub


Error: Type mismatch, Run time Error 13

Please help

Kind regards

ishwar:help