C
calebjill
I have some workbooks that upon opening ask for a password. If the password
is incorrect or not supplied then it opens in a read only format. I have a
form that gets a username and password and if it is a certain password it
opens all the excel files in a folder. If this is the case I don't want each
file to open with the input box asking for the password. I want them all to
open in editable format. Can I pass the input box password and eliminate the
box all together. Here is the code for the workbook open which is on all the
excel workbooks that will be opening.
Private Sub Workbook_Open()
Dim psswd As Variant
psswd = InputBox("Please Click Enter", "Password", "Read Only")
If psswd = "j5rt342" Then
Else
'ThisWorkbook.ChangeFileAccess xlReadOnly
Application.Run "'master.xls'!selectingallworksheets"
Application.Run "'master.xls'!unprotecting"
Application.Run "'master.xls'!selectingallworksheets"
Range("A13:M21").Select
Range("A14").Activate
Selection.Locked = True
Selection.FormulaHidden = False
Application.Run "'master.xls'!protecting"
MsgBox ("The document is open in Read Only status, if you notice anything
wrong, please contact your administrator")
End If
End Sub
is incorrect or not supplied then it opens in a read only format. I have a
form that gets a username and password and if it is a certain password it
opens all the excel files in a folder. If this is the case I don't want each
file to open with the input box asking for the password. I want them all to
open in editable format. Can I pass the input box password and eliminate the
box all together. Here is the code for the workbook open which is on all the
excel workbooks that will be opening.
Private Sub Workbook_Open()
Dim psswd As Variant
psswd = InputBox("Please Click Enter", "Password", "Read Only")
If psswd = "j5rt342" Then
Else
'ThisWorkbook.ChangeFileAccess xlReadOnly
Application.Run "'master.xls'!selectingallworksheets"
Application.Run "'master.xls'!unprotecting"
Application.Run "'master.xls'!selectingallworksheets"
Range("A13:M21").Select
Range("A14").Activate
Selection.Locked = True
Selection.FormulaHidden = False
Application.Run "'master.xls'!protecting"
MsgBox ("The document is open in Read Only status, if you notice anything
wrong, please contact your administrator")
End If
End Sub