Help; When protecting the Workbook, tab Macros won't work

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

Guest

How can I ensure that my tab Macro work when I have protected the Workbook.

I need to protect the workbook, to prevent copying of worksheets and moving
of tabs. however when the workbook and sheets are protected the macros fail
to work, resulting in an error message.

How do I overcome this?
 
In your macro, unprotect your workbook, do whatever you want to do, then
protect the workbook again eg:

ActiveWorkbook.Unprotect Password:="mypassword"
'code
ActiveWorkbook.Protect Password:="mypassword"

Hope this helps
Rowan
 

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