Smart Systems for Home

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

Excel VBA Personal Macro Workbook Setup Guide

· 6 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

A Personal Macro Workbook (Personal.xlsb) is a hidden workbook that opens automatically every time you launch Excel, allowing you to store VBA macros that are available across all your open spreadsheets rather than being tied to a single file. To create one, the fastest method is to record a dummy macro and select "Personal Macro Workbook" as the storage location in the Store Macro in dropdown menu, which forces Excel to generate the hidden file on your local drive.

What You'll Need

  • Microsoft Excel installed on a Windows or Mac computer.
  • The Developer tab enabled in the Excel Ribbon (though you can record macros via the Status Bar without it).
  • Basic understanding of how to record a macro or write a simple VBA script.

Step-by-Step

  1. Enable the Developer Tab: If you do not see the Developer tab in your top menu, right-click any existing tab (like Home or Insert) and select Customize the Ribbon. In the right-hand list, check the box next to Developer and click OK. (Note: Menu labels may vary slightly depending on your version of Excel).
  2. Initiate a Macro Recording: Click the Developer tab and select Record Macro. Alternatively, click the small square icon in the bottom-left corner of the Excel window (the Status Bar).
  3. Select the Storage Location: In the Record Macro dialog box, give your macro a simple name (e.g., "TestMacro"). Crucially, in the "Store macro in:" dropdown menu, select Personal Macro Workbook. This tells Excel to create the Personal.xlsb file if it doesn't already exist.
  4. Perform a Simple Action: Once you click OK, Excel begins recording. Perform a basic action, such as selecting a cell or typing a word in a cell. This is only to ensure the file is created and saved with content.
  5. Stop Recording: Click Stop Recording in the Developer tab or click the square stop button in the Status Bar.
  6. Open the VBA Editor: Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor.
  7. Locate the Personal Workbook: In the Project Explorer pane on the left, you will now see a project named VBAProject (PERSONAL.XLSB). Expand the folders to find the Modules folder, and double-click Module1 to see the code for the macro you just recorded.
  8. Add Your Own Macros: You can now copy and paste your existing VBA scripts into this module or right-click the Modules folder to Insert > Module for a clean workspace. Any code placed here will be accessible regardless of which Excel file you have open.
  9. Save and Exit: Close the VBA editor. When you close the main Excel application, a prompt will appear asking: "Do you want to save the changes you made to the Personal Macro Workbook?" Click Yes. If you click No, all macros added during that session will be lost.

Common Mistakes

One of the most frequent errors is saving macros in the "This Workbook" option instead of the Personal Macro Workbook. When stored in "This Workbook," the macro only works within that specific file; if you send the file to a colleague, the macro goes with it, but if you open a new blank sheet, the macro will be missing. This is the opposite of the intended goal of a Personal Macro Workbook.

Another common mistake is ignoring the save prompt upon closing Excel. Because the Personal Macro Workbook is hidden, you don't see it as an open window, so it is easy to forget that it is a separate file that requires saving. If you spend an hour writing complex automation and then close Excel without clicking "Yes" to the Personal.xlsb save prompt, your work is gone.

Users also frequently forget to unhide the workbook when they need to perform maintenance. While the workbook should remain hidden for daily use to avoid cluttering the workspace, trying to edit sheets or settings within the Personal.xlsb while it is hidden can lead to confusion. Conversely, leaving it visible can be annoying, as it creates a blank window every time Excel starts.

Tips

To make your macros truly efficient, assign them to a custom button on the Quick Access Toolbar (QAT). Right-click the QAT at the very top of the window, select Customize Quick Access Toolbar, change the "Choose commands from" dropdown to "Macros," select your Personal Macro Workbook script, and click Add. This allows you to run your global macros with a single click rather than navigating the Macro menu.

Organize your code using multiple modules. Instead of putting every single script into "Module1," right-click the Modules folder in the VBA editor and create new modules for different categories (e.g., "FormattingMacros," "DataCleaningMacros," "ReportGeneration"). This makes it significantly easier to manage your library as it grows over time.

Use a naming convention for your macros that avoids conflicts. Since these macros are global, avoid generic names like "CleanData." Instead, use a prefix like "My_CleanData" or "Global_FormatCells." This prevents errors if you open a third-party workbook that happens to have a macro with the same name.

Back up your Personal.xlsb file regularly. Since this file contains your productivity shortcuts, losing it can be a major setback. You can find the file in your computer's AppData folder (usually under XLSTART). Copying this file to a cloud backup or external drive ensures you don't have to rewrite your scripts if your OS crashes.

Troubleshooting

The Personal Macro Workbook is missing: If you recorded a macro to the Personal Macro Workbook but cannot find it in the VBA editor, check if macros are disabled. Go to File > Options > Trust Center > Trust Center Settings > Macro Settings and ensure that "Disable all macros with notification" is selected. If macros are completely disabled, the Personal.xlsb will not load.

Excel prompts to save the Personal Macro Workbook every time: This usually happens if a macro is running in the background or if a change was made to the workbook that Excel cannot automatically resolve. Ensure all your macros are finished running before closing. If the problem persists, unhide the workbook (View > Unhide), save it manually, and then hide it again.

Macros are not running in certain files: Check the file extension of the workbook you are currently using. While the Personal Macro Workbook allows you to run code on any file, the file you are working on must still be in a format that allows VBA execution if the macro interacts with the workbook's own properties. More importantly, ensure the file isn't opened in "Protected View" (the yellow bar at the top), as this blocks all macro execution for security reasons.

The VBA Project is locked: If you receive an error stating the project is unviewable, it may be because the workbook was created on a different version of Excel or is password protected. If you created it yourself, ensure you are logged into the same user profile on your PC, as the Personal.xlsb is stored in a user-specific directory.

Frequently Asked Questions

Can I share my Personal Macro Workbook with a colleague?

Yes, but not automatically. You must locate the Personal.xlsb file in your XLSTART folder and send it to them. They must then place that file into their own XLSTART folder for the macros to work on their machine.

Does the Personal Macro Workbook work on Excel for Web?

No. VBA (Visual Basic for Applications) is only supported in the desktop versions of Excel for Windows and Mac. Excel for the Web uses Office Scripts (TypeScript), which is a completely different system.

How do I hide the Personal Macro Workbook again?

If you have unhidden the workbook to edit it, go to the View tab on the Ribbon and click the Hide button in the Window group. This will return it to its background state.

Will my Personal Macro Workbook slow down Excel's startup time?

Generally, no. Unless you have written an "Auto_Open" macro that performs heavy calculations or connects to a slow external database upon launch, the Personal.xlsb loads almost instantaneously.

What is the difference between .xlsb and .xlsm?

The .xlsb extension is a binary format. It is used for the Personal Macro Workbook because it loads and saves faster than the XML-based .xlsm format, which is beneficial for a file that opens every time you start the application.