You can turn on the macro recorder and make the changes manually. This will
give you the code you need. You would simply call such code from the
workbook_open event. Keeping the new password would require saving the
workbook.
At least for sheet level protection, you would need to unprotect the sheet
using the existing password, then reprotect it with a new password. I would
suspect this would be the case for other passwords as well.
--
Regards,
Tom Ogilvy
"XP" wrote:
> Using Office 2003 and Windows XP;
>
> Is it possible to code a workbook to alter or change its sheet, workbook,
> and module protection passwords on the fly? I would like to tie the change
> trigger to the workbook's Open event.
>
> I already know about the weaknesses involved in using Office passwords; this
> is just an extra measure to go one step further to prevent prying eyes and
> mistakes;
>
> Example VBA would be most appreciated.
|