logo
search
VBA & Macro Problems

Alternatives to Excel Macros for SharePoint and Excel Online

Maira MehtabMaira Mehtab Sep 22, 2026 870 views

Question details

The user is looking for an online alternative to traditional Excel macros that works in SharePoint or Excel for the web to perform tasks like preventing copy and paste and highlighting modified client data.

Product
Microsoft Excel (SharePoint / Excel for the web)
Device & OS
not provided
Scenario
Attempting to automate cell highlighting and restrict copy-pasting in a shared workbook hosted in a web environment.
Observed behavior
Traditional VBA macros do not run or function correctly in Excel for the web, limiting the ability to automate workbook control and enforce data protection online.
Before you start

Before exploring online alternatives, ensure your workbook is saved in a cloud location like SharePoint or OneDrive, and verify if your Microsoft 365 subscription includes access to modern automation tools like Office Scripts and Power Automate.

Solution 1Recommended

Force Opening in Desktop Excel Using a Welcome Sheet

Since Excel for the web cannot run VBA macros, hide sensitive sheets and display an instruction sheet directing users to open the file in the desktop app where macros are supported.

This method ensures that users must use the desktop version of Excel, where traditional VBA macros (including copy/paste restrictions and event-based highlighting) function perfectly.

1
Create an instruction sheet

Add a new worksheet and name it 'Welcome' or 'Instructions'. Add text explaining that macros must be enabled and the file must be opened in the desktop app to function properly.

2
Hide sheets on close

Open the VBA Editor (Alt + F11), double-click 'ThisWorkbook', and use the 'Workbook_BeforeClose' event to hide all sheets except the 'Welcome' sheet.

3
Unhide sheets on open

In the same module, use the 'Workbook_Open' event to write a script that unhides the necessary sheets as soon as macros are enabled upon opening the desktop application.

Free Microsoft Office alternative

Experience Powerful Macro Support with WPS Office

If you are struggling with VBA macro limitations in Excel for the web, consider using WPS Office. WPS Spreadsheet provides robust desktop-level VBA and JS macro support, allowing you to seamlessly automate tasks and restrict workbook actions without relying on complex online workarounds.

  1. 1. Install WPS Office: Download and install WPS Office on your desktop computer.
  2. 2. Open your macro file: Open your .xlsm or .xls file using WPS Spreadsheet.
  3. 3. Run your macros: Navigate to the 'Developer' tab to manage, edit, and run your VBA macros with full desktop capabilities.
Fully compatible with Microsoft Excel macro-enabled formats (.xlsm, .xlsb).Supports both VBA and JS Macros for advanced local automation.Lightweight, fast, and free to download and use.Includes built-in document protection to restrict copying, printing, and editing.
microsoft office alternative - wps office

Frequently Asked Questions

Why do my Excel macros not work in SharePoint or Excel for the web?

Excel for the web does not support traditional VBA (Visual Basic for Applications) macros. VBA requires the underlying architecture of the desktop application environment to run correctly.

Can Office Scripts completely replace VBA macros in Excel Online?

Not entirely. While Office Scripts are excellent for automating repetitive tasks and manipulating data online, they lack the deep workbook control and event-handling capabilities (such as preventing copy/paste or intercepting keystrokes) found in desktop VBA.

How can I prevent users from copying data in Excel Online?

Browser-based security heavily limits the ability to prevent users from copying data via scripts. The best approach is to use SharePoint permissions to restrict file downloading, or force users to use the desktop app where VBA protections can be strictly applied.

Does Power Automate work with Excel desktop macros?

Power Automate integrates seamlessly with Office Scripts in Excel for the web, but it cannot directly trigger desktop VBA macros. To automate workflows via Power Automate in the cloud, you must transition your automation logic to Office Scripts.