logo
search
VBA & Macro Problems

How to Fix Excel VBA Permission.Add Error 80070491

Bushra ParveenBushra Parveen Sep 28, 2026 869 views

Question details

Users encounter run-time error -2147023727 (80070491) when executing a VBA macro that assigns workbook permissions.

How to Fix Excel VBA Permission.Add Error 80070491
Product
Microsoft Excel
Device & OS
not provided
Scenario
Running an Excel VBA macro containing the ActiveWorkbook.Permission.Add method under a new organization or tenant account.
Observed behavior
The VBA macro crashes and returns run-time error 80070491, despite the exact same code executing successfully in other organizational environments.
Before you start

Ensure you have your current Microsoft 365 account credentials available, as troubleshooting this error frequently requires refreshing your authentication token.

Solution 1Recommended

Refresh Your Microsoft 365 Authentication Token

Because the macro works in other organizations, the error is often caused by a stale token or an improper sync with Microsoft Information Protection. Signing out and back in can resolve this.

Rights management protocols require an active, validated connection to your tenant. If your account token has expired or is holding onto outdated policies from a previous organization, the Permission.Add method will fail.

1
Sign out of Excel

Open Microsoft Excel, navigate to the 'File' menu, select 'Account' from the bottom left, and click the 'Sign out' button under your user profile.

2
Restart the application

Close all instances of Excel completely to ensure the session is cleared from memory.

3
Sign back in

Reopen Excel, go back to 'File' > 'Account', click 'Sign in', and enter your current organizational credentials.

Refresh Your Microsoft 365 Authentication Token
Session Cleared: Refreshing your login state forces Excel to download the latest rights management policies from your tenant.
Free Microsoft Office alternative

Experience Seamless VBA Support with WPS Office

Tired of dealing with complex Microsoft 365 tenant configurations and restrictive permission errors? Try WPS Office. It provides a lightweight, free alternative with robust built-in VBA support, allowing you to run your macros without the hassle of restrictive Information Protection barriers.

  1. 1. Download the installer: Visit the official WPS Office website and click the free download button.
  2. 2. Install the software: Run the downloaded executable file and follow the simple on-screen instructions to install WPS Office on your device.
  3. 3. Run your macros: Open WPS Spreadsheet, load your .xlsm file, and execute your VBA scripts smoothly.
Free, lightweight, and fast-loading Office suiteExcellent compatibility with Microsoft Excel formats (.xlsx, .xls, .xlsm)Built-in robust support for VBA and macrosNo complex tenant-level Information Protection configurations required
microsoft office alternative - wps office

Frequently Asked Questions

What causes run-time error 80070491 in Excel VBA?

This error occurs when the ActiveWorkbook.Permission.Add method fails to execute. It is rarely a syntax error; instead, it is usually caused by restrictive Microsoft Information Protection policies, disabled rights management in a new tenant, or a stale account authentication token.

Why does my VBA macro work in one organization but not another?

Different Microsoft 365 organizations (tenants) have different security and compliance settings. If the new organization has strict Information Protection policies or has not enabled rights management for your account, macros attempting to assign workbook permissions will fail.

How do I check my MsoPermission enumeration in VBA?

Open the VBA Editor (Alt + F11), locate your Permission.Add method, and check the parameters passed to it. You can highlight the word 'MsoPermission' and press F1 to open the Microsoft documentation, which lists all valid enumeration values such as msoPermissionRead and msoPermissionChange.

Can I run macro-enabled workbooks in WPS Office?

Yes, WPS Spreadsheet offers excellent support for VBA macros. You can open your .xlsm files and run your scripts efficiently without worrying about complex Microsoft 365 tenant-level permission barriers.