Change passwords on fly

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top