Protecting an entire workbook

D

dumbass

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
 
V

Vasant Nanavati

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:
 
Top