Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Please help me to discover what is wrong with this excerpt from a macro that
I am writing to protect a sheet in my workbook with a password. I keep getting the compile error message. __________________________________________________ ActiveSheet.Protect Password:="PASS" DrawingObjects:=True, Contents:=True, Scenarios:=True ActiveWindow.SelectedSheets.Visible = False |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
What line causes the error?
Those first two lines are really one logical line: ActiveSheet.Protect Password:="PASS", DrawingObjects:=True, _ Contents:=True, Scenarios:=True And you need a comma between each parameter (before drawingObjects) The spacecharacter followed by an underscore is the continuation character in VBA. Teddy-B wrote: Please help me to discover what is wrong with this excerpt from a macro that I am writing to protect a sheet in my workbook with a password. I keep getting the compile error message. __________________________________________________ ActiveSheet.Protect Password:="PASS" DrawingObjects:=True, Contents:=True, Scenarios:=True ActiveWindow.SelectedSheets.Visible = False -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code to protect/unprotect a sheet using a macro with password | Excel Discussion (Misc queries) | |||
Using "Countif" in macro gives compile error | Excel Discussion (Misc queries) | |||
Add protect worksheet password in macro | Excel Worksheet Functions | |||
Macro / Compile Error / Duplicate Declaration | Excel Worksheet Functions | |||
how do i password protect an .xls file? how do i unlock it for automation. e.g. want to unlock and access a .xls from another .xls macro. | Excel Worksheet Functions |