PDA

View Full Version : Help with Password



zebradoby
11-28-2007, 01:33 PM
When I run the macro, How do I unprotect the workbook and worksheets automatically , and then protect them again via VBA when the macro has been completely run?


Can anyone help ?

To Run the macro:
1. Save the Template on C:\ as Template1.xls
2. Click Run on TestMacro.xls
3. Select SourceFile3.xls to process
4. File is saved at C:\

mikerickson
11-28-2007, 04:56 PM
ActiveWorkbook.Unprotect "password"
ActiveSheet.Unprotect "password"

Rem your code

ActiveSheet.Protect "password"
ActiveWorkbook.Protect "password"