VBA & Macro Problems

Enable Outline Groups on a Protected Excel Sheet Stored in SharePoint

Muhammad TalhaMuhammad Talha Nov 12, 2026 868 views

Question details

Enable or manage row and column outline groups in a protected Excel worksheet stored on SharePoint.

Enable Outline Groups on a Protected Excel Sheet Stored in 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.
Before you start

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.

Solution 1Recommended

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.

1
Open the workbook from SharePoint

In the SharePoint document library, select the workbook and choose Open in app or Open in Desktop App.

2
Enable workbook macros when appropriate

In desktop Excel, select Enable Content if the security notification appears and the workbook is from a trusted source.

3
Run the outlining procedure

Select Developer > Macros, choose the workbook macro that enables or manages outline groups, and select Run.

4
Save the updated workbook

Select File > Save or press Ctrl+S to save the changes back to the SharePoint library.

Open the SharePoint workbook in the desktop Excel application
Browser limitation: Users can still view the SharePoint workbook in Excel for the web, but VBA-driven grouping tasks must be performed in desktop Excel.
Free Microsoft Office alternative

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.

Lightweight desktop spreadsheet editing for users who need more than browser-only workbook accessFamiliar spreadsheet interface helps users transition from Microsoft Excel workflowsSupports opening and saving Microsoft Excel .xlsx and .xls filesProvides worksheet organization tools for working with rows, columns, and grouped data
microsoft office alternative - wps office

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.