A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
If the workbook was downloaded from a website, Excel is likely blocking its VBA macros because the file has Mark of the Web.
Try this in order:
- Close the workbook.
- In File Explorer, right-click the Excel file and select Properties.
- On the General tab, look for Security at the bottom.
- If Unblock is available, check Unblock, then select Apply and OK.
- Reopen the workbook.
If Unblock is not available or the macros are still blocked:
- Move the file to a local folder that is trusted.
- In Excel, go to File > Options > Trust Center > Trust Center Settings.
- Select Trusted Locations.
- Add the folder where the workbook is stored.
- Reopen the workbook from that trusted location.
If the file is on OneDrive or SharePoint:
- Open it by using Open in Desktop App, or
- Download it locally first and then remove Mark of the Web from the local copy by using Properties > Unblock.
If a yellow Security Warning bar appears instead of a hard block, select Enable Content to trust that document.
Important: only do this for files that are trusted. Microsoft notes that macros can contain malicious code, and macros are not required just to view or edit the file.
If the workbook is on a work-managed device, organization policy can override Trust Center settings and continue blocking macros. In that case, the file location may need to be added as a trusted site or local intranet location by IT.