Morning Sam,
the quickest way to add a password popup is to use an input box. Downside to
this is that the password is fully visible ie you cannot change text for
"****" characters.
More involved would be to create another userform with textbox & button.
Change the textbox PasswordChr property to "*" and then test user input
against your password.
code for inputbox would look something like following:
Dim DBFile As String
Dim MyPassword As String
Dim PassWrd As Variant
Dim iRow As Long
Dim ws As Worksheet
MyPassword = "new"
PassWrd = InputBox("Enter Password : ", "Sams System")
If PassWrd = "" Then Exit Sub
If PassWrd = MyPassword Then
DBFile = "H:\myfiles\Demo.xlsm"
Set DestWB = Workbooks.Open(DBFile, Password:=MyPassword)
Set ws = DestWB.Worksheets("Sheet1")
'find first empty row in database
With ws
iRow = .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0).Row
'do all your stuff here that refers to the shared workbook
End With
DestWB.Close True
Else
msg = MsgBox("Inavalid Password", 16, "Sams System")
End If
if you need further help with this contact me directly nospamdt @ btinternet
..com (close spaces)