Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Macros: Where Are They Saved and How to Find Them?

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Excel macros are saved in one of two places: either within a specific workbook file (saved as an .xlsm or .xlsb file) or in a hidden system file called the Personal Macro Workbook (Personal.xlsb). If you recorded a macro and chose "This Workbook," it stays with that file; if you chose "Personal Macro Workbook," it is available across all Excel files on your computer.

Understanding these locations is critical because if you save a macro in a standard .xlsx file, Excel will strip the macro code away upon saving, and your work will be lost. Depending on where the macro is stored, the method for accessing and managing the code differs.

What You'll Need

  • Microsoft Excel installed on a Windows or Mac computer.
  • The "Developer" tab enabled in the Excel Ribbon (though not strictly required for finding files, it is necessary for managing them).
  • Administrator permissions on your computer if you intend to move or back up the Personal Macro Workbook file.

Step-by-Step

Depending on whether your macro is workbook-specific or global, follow the corresponding steps below. Note that menu labels may differ slightly based on your version of Excel or operating system.

Method 1: Finding Macros Saved in a Specific Workbook

  1. Open the Excel file that contains the macro.
  2. Press Alt + F11 (Windows) or Option + F11 (Mac) to open the Visual Basic for Applications (VBA) Editor.
  3. In the "Project Explorer" pane on the left side of the screen, look for the folder labeled Project (YourFileName.xlsm).
  4. Expand the Modules folder.
  5. Double-click the module (e.g., Module1) to view the actual VBA code saved within that specific file.
  6. To ensure these macros stay saved, go to File > Save As and ensure the file type is set to Excel Macro-Enabled Workbook (.xlsm).

Method 2: Finding the Personal Macro Workbook (Global Macros)

  1. Open Excel.
  2. Press Alt + F11 to open the VBA Editor.
  3. In the Project Explorer pane, look for VBAProject (PERSONAL.XLSB). This is the hidden file where all "global" macros are stored.
  4. Expand the Modules folder under PERSONAL.XLSB to see your shared macros.
  5. To find the actual physical file on your hard drive (for backup purposes), navigate to the following folder path on Windows: C:\Users\[YourUsername]\AppData\Roaming\Microsoft\Excel\XLSTART.
  6. On a Mac, the file is typically located in the XLSTART folder within the Microsoft Excel application support directory.

Method 3: Using the Macro Dialog Box

  1. Go to the Developer tab on the Ribbon. (If you don't see it, right-click any tab, select "Customize the Ribbon," and check the "Developer" box).
  2. Click the Macros button.
  3. In the "Macros in:" dropdown menu at the bottom of the window, switch between This Workbook and PERSONAL.XLSB.
  4. Select a macro from the list and click Edit to be taken directly to the location where the code is saved in the VBA Editor.

Common Mistakes

  • Saving as .xlsx: This is the most common error. Standard Excel workbooks (.xlsx) cannot store macros. If you save a macro-enabled file as a standard workbook, Excel will warn you that features will be lost. If you click "Yes," the macros are permanently deleted.
  • Confusing "This Workbook" with "Personal": Users often record a macro in the Personal Macro Workbook and then wonder why it doesn't work when they send the file to a colleague. Since the Personal Macro Workbook is stored locally on your computer, the macros do not travel with the file.
  • Ignoring the Hidden Status: The Personal.xlsb file is hidden by default in the Excel interface. Users often think it has been deleted because they cannot see it in their open windows, even though it is running in the background.

Tips

  • Backup your Personal.xlsb: Since the Personal Macro Workbook is a single file on your hard drive, a computer crash can wipe out years of automation. Periodically copy the Personal.xlsb file from the XLSTART folder to a cloud backup.
  • Use .xlsb for Large Files: If your workbook is massive and contains many macros, consider saving it as an Excel Binary Workbook (.xlsb). This format often opens and saves faster than .xlsm.
  • Naming Conventions: When saving macros in the Personal Macro Workbook, start the name with a prefix (e.g., Global_FormatCells) so you can easily distinguish them from workbook-specific macros.

Troubleshooting

If you cannot find your macros, try these steps in order:

  1. Check the File Extension: Look at the top of your Excel window. If the file ends in .xlsx, the macros were likely not saved or were deleted during the last save operation.
  2. Check for Disabled Macros: If the macros exist but won't run, go to File > Options > Trust Center > Trust Center Settings > Macro Settings. Ensure that macros are not completely disabled without notification.
  3. Unhide the Personal Workbook: If you know you have a Personal Macro Workbook but can't see it, go to the View tab and click Unhide. Select PERSONAL.XLSB from the list.
  4. Verify the XLSTART Folder: If the VBA Editor does not show "PERSONAL.XLSB," check the XLSTART folder on your hard drive. If the folder is empty, the Personal Macro Workbook was never created or has been moved.

Frequently Asked Questions

Can I move a macro from a workbook to the Personal Macro Workbook?

Yes. Open the VBA Editor (Alt + F11), find the module in the specific workbook, and drag-and-drop that module into the VBAProject (PERSONAL.XLSB) project in the Project Explorer pane.

Do macros save automatically?

Macros saved in a workbook are saved when you save the file. However, when you close Excel, it may ask if you want to save changes to the Personal Macro Workbook. You must click "Save" for any changes made to global macros to be kept.

Why can't I see the Developer tab?

The Developer tab is hidden by default. To enable it, right-click any existing tab on the Ribbon, select "Customize the Ribbon," and check the box next to "Developer" in the right-hand column.

Will my macros work on another person's computer?

Only if they are saved in the workbook (.xlsm) and the other person enables macros upon opening the file. Macros saved in your Personal Macro Workbook will not work on any other computer.

Is there a limit to how many macros I can save?

There is no specific "number" limit, but very large amounts of VBA code can increase the file size and potentially slow down the application's startup time, especially if stored in the Personal Macro Workbook.