Fro everything I know this is impossible. You would put such a function in
the Workbook_Open event, but the user could just break the routine with
Ctrl-Break, or open it without macros and look around for the required
password.
Why not just save the file password protected?
File-Save As
Click Tools drop down and select "General Options", set a password ... prior
to clicking Save
Bill
"Linking to specific cells in pivot table"
crosoft.com wrote in
message ...
Hi - I'd like to do the following and am hoping to get guidance on how to
do
this:
- Create a form which asks the user to input a password -- if the password
is correct, the user is able to access the spreadsheet. If the password
is
incorrect, the user is not able to access the spreadsheet.
- Have the form described above automatically open when the file is
opened.
I have a created a form in VB, but am honestly not sure how I should
approach the password issue and then how to get it to automatically pop up
when the file is opened (I'm assuming I can initiate the form under
'Option
Explicit', but haven't been able to figure out the sytax for initiating a
form there).
Any help you can provide is appreciated!
Robert