Hi all,
I am attempting to allow users to expand/collapse (+/-) groupings I already created under a protected worksheet (workbook as well). I would like VBA to (auto) run when worksheet is open. Below is the code I have:
Private Sub Workbook_Open()
With Worksheets("TRUCK Utilization")
.Unprotect Password:="password"
.EnableOutlining = True
.Protect Password:="password", contents:=True, UserInterfaceOnly:=True
End With
End Sub
When I test- open up workbook- and attempt to collapse grouping, a message box pops up saying, "You cannot use this command on a protected sheet. To use this command, you must first unprotect the sheet..."
Problem is that the expand/collapse feature only works after I open VB and run code (after I run it and toggle back to worksheet, it works). Is there a way to have it run without the end user having to go into VBA to have it work in Excel 2010? Possibly have it run when workbook is open on a different computer?
I am attempting to allow users to expand/collapse (+/-) groupings I already created under a protected worksheet (workbook as well). I would like VBA to (auto) run when worksheet is open. Below is the code I have:
Private Sub Workbook_Open()
With Worksheets("TRUCK Utilization")
.Unprotect Password:="password"
.EnableOutlining = True
.Protect Password:="password", contents:=True, UserInterfaceOnly:=True
End With
End Sub
When I test- open up workbook- and attempt to collapse grouping, a message box pops up saying, "You cannot use this command on a protected sheet. To use this command, you must first unprotect the sheet..."
Problem is that the expand/collapse feature only works after I open VB and run code (after I run it and toggle back to worksheet, it works). Is there a way to have it run without the end user having to go into VBA to have it work in Excel 2010? Possibly have it run when workbook is open on a different computer?
Last edited: