Thread: User Password
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
George Nicholson George Nicholson is offline
external usenet poster
 
Posts: 149
Default User Password

XL2003: FileSaveAsToolsMenuGeneralOptions
Allows you to enter a password to open and, optionally, a password to modify
(i.e., if opened, it can't be saved unless the modify password is known).

However, this may not do exactly what you wish: your code will still run,
adding sheets that the user won't be able to save.

Consider asking the user for a password when the workbook opens. Don't let
your code run and cancel Workbook_Save if that password is not supplied.

There are also methods to password protect individual worksheet elements:
ToolsProtection

HTH,

"jnf40" wrote in message
...
I need to open a workbook and have it ask the user for a password. If they
know the password then they can use the workbook, however if they do not
know
the password then they can only view what the workbook has in it.
The workbook has a lot of code in it and creates sheets automatically but
there will only be a couple of users that will actually enter data, the
rest
will just need to view the information entered without the ability to make
any changes. Is there a way to do this when the workbook opens?