How to Fix Excel VBA Permission.Add Error 80070491
Question details
Users encounter run-time error -2147023727 (80070491) when executing a VBA macro that assigns workbook permissions.

- 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.
Ensure you have your current Microsoft 365 account credentials available, as troubleshooting this error frequently requires refreshing your authentication token.
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.
Open Microsoft Excel, navigate to the 'File' menu, select 'Account' from the bottom left, and click the 'Sign out' button under your user profile.
Close all instances of Excel completely to ensure the session is cleared from memory.
Reopen Excel, go back to 'File' > 'Account', click 'Sign in', and enter your current organizational credentials.

Modify the MsoPermission Enumeration
Certain permission levels might be restricted by your new organization's security policies. Changing the requested permission level can bypass this restriction.
Verify Tenant Rights Management Configuration
If the code itself is unchanged but fails on a new account, the Microsoft 365 tenant may lack the necessary Information Protection configurations.
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. Download the installer: Visit the official WPS Office website and click the free download button.
- 2. Install the software: Run the downloaded executable file and follow the simple on-screen instructions to install WPS Office on your device.
- 3. Run your macros: Open WPS Spreadsheet, load your .xlsm file, and execute your VBA scripts smoothly.

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.




