Hi,
I'm trying to enable outlining in VBA so I can group rows together, but also have the sheet protected so functions are proctected from deletion. The kicker is that the sheet also needs to be a "shared workbook", which inhibits protecting the sheet.
I have the code below that works until the sheet is shared, and then it gives an error. I'm wondering if there is another way to enable outlining so that its enabled anytime the sheet is opened, but without needing to protect it.
Thanks for any help!
ActiveWorkbook.Worksheets("sheet1").EnableOutlining = True
ActiveWorkbook.Worksheets("sheet1").protect contents:=True, userInterfaceOnly:=True
I'm trying to enable outlining in VBA so I can group rows together, but also have the sheet protected so functions are proctected from deletion. The kicker is that the sheet also needs to be a "shared workbook", which inhibits protecting the sheet.
I have the code below that works until the sheet is shared, and then it gives an error. I'm wondering if there is another way to enable outlining so that its enabled anytime the sheet is opened, but without needing to protect it.
Thanks for any help!
ActiveWorkbook.Worksheets("sheet1").EnableOutlining = True
ActiveWorkbook.Worksheets("sheet1").protect contents:=True, userInterfaceOnly:=True