Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sheet Protection Macro
I have the following code in my workbook. It allow the user to utilize the
outline and grouping, but it will not allow them to add and delete rows. Private Sub Workbook_Open() With Worksheets("vendorcommodities_detail") ActiveSheet.Protect DrawingObjects:=True, Contents:=True, _ Scenarios:=True, AllowInsertingColumns:=True, _ AllowInsertingRows:=True, AllowDeletingColumns:=True, _ AllowDeletingRows:=True .Protect Password:="add", userinterfaceonly:=True .EnableOutlining = True End With End Sub Since I am new to VBA, I am having trouble locating why it wont work. Thanks DIane |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sheet Protection Macro
Try it this way:
Private Sub Workbook_Open() With Worksheets("vendorcommodities_detail") .EnableOutlining = True .Protect DrawingObjects:=True, Contents:=True, _ Scenarios:=True, AllowInsertingColumns:=True, _ AllowInsertingRows:=True, AllowDeletingColumns:=True, _ AllowDeletingRows:=True, Password:="add", _ userinterfaceonly:=True End With End Sub -- Regards, Tom Ogilvy "diaare" wrote: I have the following code in my workbook. It allow the user to utilize the outline and grouping, but it will not allow them to add and delete rows. Private Sub Workbook_Open() With Worksheets("vendorcommodities_detail") ActiveSheet.Protect DrawingObjects:=True, Contents:=True, _ Scenarios:=True, AllowInsertingColumns:=True, _ AllowInsertingRows:=True, AllowDeletingColumns:=True, _ AllowDeletingRows:=True .Protect Password:="add", userinterfaceonly:=True .EnableOutlining = True End With End Sub Since I am new to VBA, I am having trouble locating why it wont work. Thanks DIane |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sheet Protection Macro
Perfect! Thank you
"Tom Ogilvy" wrote: Try it this way: Private Sub Workbook_Open() With Worksheets("vendorcommodities_detail") .EnableOutlining = True .Protect DrawingObjects:=True, Contents:=True, _ Scenarios:=True, AllowInsertingColumns:=True, _ AllowInsertingRows:=True, AllowDeletingColumns:=True, _ AllowDeletingRows:=True, Password:="add", _ userinterfaceonly:=True End With End Sub -- Regards, Tom Ogilvy "diaare" wrote: I have the following code in my workbook. It allow the user to utilize the outline and grouping, but it will not allow them to add and delete rows. Private Sub Workbook_Open() With Worksheets("vendorcommodities_detail") ActiveSheet.Protect DrawingObjects:=True, Contents:=True, _ Scenarios:=True, AllowInsertingColumns:=True, _ AllowInsertingRows:=True, AllowDeletingColumns:=True, _ AllowDeletingRows:=True .Protect Password:="add", userinterfaceonly:=True .EnableOutlining = True End With End Sub Since I am new to VBA, I am having trouble locating why it wont work. Thanks DIane |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Data Protection Best Practice: AKA: Real Sheet Protection | Excel Discussion (Misc queries) | |||
Excel Data Protection- AKA: Sheet/Macro Password Protection | Setting up and Configuration of Excel | |||
Can a Macro override sheet Protection? | Excel Discussion (Misc queries) | |||
with sheet protection on, macro won't run to add borders around a | Excel Programming | |||
Sheet protection error msg - Unrequested sheet activation | Excel Programming |