Protecting an entire workbook

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

Guest

Hi

I wrote a macro that saves a worksheet by state into a file for each branch; however, I would like to protect the entire workbook being saved before saving. I tried

For brancher = 1 To
bookername(brancher).Activat
ActiveWorkbook.Protect password:="millertime
ActiveWorkbook.Sav
ActiveWorkbook.Clos
Next branche

When the code executes, I do not get an error, but when I open that file open, there is no protection.

Thanks for the help
 
Protecting a workbook is *not* the same as protecting all the worksheets.
Look at Help to understand the differences.

--

Vasant

dumbass said:
Hi-

I wrote a macro that saves a worksheet by state into a file for each
branch; however, I would like to protect the entire workbook being saved
before saving. I tried:
 

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