Enable Outline Groups on a Protected Excel Sheet Stored in SharePoint
Question details
Enable or manage row and column outline groups in a protected Excel worksheet stored on SharePoint.

- Product
- Microsoft Excel for the web with SharePoint
- Device & OS
- not provided
- Scenario
- A workbook uses VBA to enable or manage outline groups while worksheets are protected and shared through SharePoint.
- Observed behavior
- VBA macros do not run in Excel for the web, so the desktop VBA method cannot perform the required outlining actions in the browser.
Confirm whether the workbook must be edited in a browser or whether designated users can open it in the desktop Excel app. Also identify whether grouping must be created, expanded and collapsed, or changed while worksheet protection remains enabled.
Open the SharePoint workbook in the desktop Excel application
Use this option when the existing solution depends on VBA or advanced outline and protection behavior.
Excel for the web does not run VBA macros. Opening the SharePoint-hosted workbook in desktop Excel allows approved users to run the workbook's VBA procedure and use desktop-only worksheet features.
In the SharePoint document library, select the workbook and choose Open in app or Open in Desktop App.
In desktop Excel, select Enable Content if the security notification appears and the workbook is from a trusted source.
Select Developer > Macros, choose the workbook macro that enables or manages outline groups, and select Run.
Select File > Save or press Ctrl+S to save the changes back to the SharePoint library.

Evaluate Office Scripts, an Office Add-in, or Power Automate for web workflows
Use this option when users must initiate a supported automation workflow from Excel for the web or SharePoint.
Use WPS Office for desktop spreadsheet editing and macro-based workflows
Excel for the web cannot run VBA, and WPS Office cannot change that Microsoft browser limitation. If your team needs a free, lightweight desktop office suite for working with compatible spreadsheets and familiar worksheet tools, WPS Office provides an easy migration path for many Excel-based editing workflows.

Frequently Asked Questions
Can VBA macros run in Excel for the web?
No. Excel for the web does not run VBA macros. Open the workbook through SharePoint using Open in Desktop App to run VBA in desktop Excel.
Can users expand or collapse existing outline groups in Excel for the web?
Availability can depend on the workbook and web feature support, but VBA cannot be used in the browser to create or manage those groups. Test the required interaction in the web workbook and use desktop Excel when advanced outline actions are needed.
Why does worksheet protection affect outline group automation?
Protection can limit changes to grouped rows, columns, and outline settings. A desktop VBA procedure may need to manage worksheet protection before changing the outline, subject to the workbook's protection design.
Can Office Scripts replace VBA for protected worksheet grouping?
Possibly for some scenarios, but it is not a guaranteed replacement. In Excel for the web, select Automate > New Script and test the required grouping and protection actions in a copy of the workbook.
Will changes made in desktop Excel save back to SharePoint?
Yes. When the workbook is opened from SharePoint in desktop Excel, use File > Save or Ctrl+S to save authorized changes back to the SharePoint document library.




