A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Excel is blocking the macros because the file is marked as coming from the Internet (it has Mark of the Web/ZoneId=3). To allow macros, the Mark of the Web must be removed or the file must be opened from a trusted location/zone.
Use one of these approaches:
- Remove Mark of the Web from the downloaded file
- In File Explorer, right‑click the .xlsm file.
- Select Properties.
- On the General tab, if you see Unblock, select the Unblock checkbox, then select OK.
- Reopen the workbook; macros should now be allowed (subject to your macro settings).
- Open Command Prompt or PowerShell.
- Run the PowerShell cmdlet (adjust the path and file name):
Unblock-File -Path "C:\Path\To\YourFile.xlsm" - This removes the ZoneId (Mark of the Web) so VBA macros can run by default.
- Store or open the file from a trusted location/zone
- If the file is on a network share or website and there is no Unblock option, either:
- Move/download the file to a local folder and then use Unblock or
Unblock-File, or - Add that network location as a Trusted site or ensure it is in the Local intranet zone via Control Panel > Internet Options > Security.
- Move/download the file to a local folder and then use Unblock or
- For OneDrive/SharePoint files:
- Use Open in Desktop App directly from OneDrive/SharePoint; in this case the file will not have Mark of the Web.
- Or sync via the OneDrive sync client and open the synced copy; synced files do not get Mark of the Web.
- If the file is on a network share or website and there is no Unblock option, either:
- Verify macro policy settings (if still blocked)
- If using Microsoft 365 Apps for enterprise and an admin has enabled the Block macros from running in Office files from the Internet policy, macros in Internet‑sourced files will remain blocked even after unblocking, unless policy is changed.
- In that case, an admin must adjust macro policies (for example, using VBA Macro Notification Settings or trusted, signed macros) so that trusted files can run macros.
Once the Mark of the Web is removed (or the file is opened from a trusted zone/location) and macro policies allow it, Excel will stop blocking the macros in that .xlsm file.
References: