All macros are removed immediately when opening Excel.

alice 薛 0 Reputation points
2026-08-02T04:14:44.9766667+00:00

The operating system is Windows 11 Enterprise, and Microsoft Office Home 2024 is installed. Macros are automatically stripped when using macro-enabled files.

Microsoft 365 and Office | Excel | For home | Windows
0 comments No comments

1 answer

Sort by: Most helpful
  1. Kai-H 23,910 Reputation points Microsoft External Staff Moderator
    2026-08-03T08:21:32.61+00:00

    Hi, alice 薛

    Office Home 2024 supports VBA macros. Excel security settings may block macros from running, especially in downloaded files, but they should not normally delete the VBA project. If the code is genuinely disappearing, the file may be getting saved as .xlsx or modified by an organization security policy.

    Here are some suggestions you can try:

    First, make a backup of an affected file. Confirm its extension is .xlsm or .xlsb, not .xlsx. When saving, select Excel Macro-Enabled Workbook (*.xlsm). Macro-containing Excel files require a macro-enabled format.

    Move one test file to a local folder such as Documents. Right-click it, select Properties, check Unblock if shown, then select Apply. Files downloaded from the internet or received as attachments can have their macros blocked.

    In Excel, select File > Options > Trust Center > Trust Center Settings > Macro Settings, then choose Disable VBA macros with notification. Reopen the file and use Enable Content only if you trust it. Avoid enabling all macros globally.

    Since Windows 11 Enterprise is organization-managed, check whether those settings are locked. If they are, contact your IT administrator because Group Policy, antivirus, or file-sanitizing software may be altering the workbook.

    Test with a copied file rather than the only original.

    Thank you for your patience in reading, I hope this information has been helpful to you. 


    If the answer is helpful, please click "Yes" and kindly upvote it. If you have extra questions about this answer, please click "Comment."    

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.