Hi
I am trying to write some code that when the workbook is opened, it prompts the user for a password and if an invalid password is entered it closes the workbook.
This seems pretty simple. Putting the below snippet into the open event ...
pass_dpanel.Show
If (pass_dpanel.TextBox1.Value <> "correct") Then
' not valid password
MsgBox ("invalid password")
ActiveWorkbook.Close
End If
Which works ok until I copy the workbook onto our web server. This time when an incrrect password is entered a duplicate file is opened myworkbook[1].xls and if an incorrecte passwrod is entered for a seccond time I get an "Invalid operation" error.
Any ideas ?
Bookmarks