VBA & Macro Problems

Fix Microsoft Access Stopped Working After VBA CommandBar Code

Maira MehtabMaira Mehtab Nov 2, 2026 869 views

Question details

Users are unable to open existing databases or create new ones in Microsoft Access after executing VBA code that hides all command bars.

How to Fix Microsoft Access Stopping Work After VBA CommandBar Code
Product
Microsoft Access
Device & OS
not provided
Scenario
Running VBA code to completely hide the Access interface by setting Application.CommandBars(i).Visible to False.
Observed behavior
Microsoft Access crashes, fails to open existing databases, or stops creating new files because the user interface is completely disabled by obsolete code.
Before you start

Ensure you have access to the original database file on a local computer drive, as running Access applications directly from a removable USB drive on another machine can cause unexpected crashes.

Solution 1Recommended

Bypass Startup Code Using the Shift Key

Use the Shift key method to prevent the problematic VBA code from running automatically, allowing you to access the database and remove the obsolete code.

In newer versions of Microsoft Access, the traditional CommandBar interface has been replaced by the Ribbon. Using older VBA code to hide CommandBars can corrupt the application's startup sequence. Bypassing the startup code is the safest way to regain access to your file.

1
Hold the Shift Key

Before opening your database, press and hold down the 'Shift' key on your keyboard.

2
Open the Database

While continuing to hold the Shift key, double-click your Microsoft Access database file to open it.

3
Keep Holding Until Open

Keep holding the Shift key until the database is fully open. This action forces Access to bypass all startup macros and VBA code.

4
Open the VBA Editor

Press 'Alt + F11' on your keyboard to open the Microsoft Visual Basic for Applications (VBA) editor.

5
Remove Obsolete Code

Locate the 'Application.CommandBars(i).Visible = False' code in your modules, delete or comment it out, and then save the database.

Code Obsolescence: The CommandBars method is obsolete in modern versions of Access. It should no longer be used to disable or hide the Access interface.
Free Microsoft Office alternative

Looking for a Lightweight Alternative for Data Management?

While Microsoft Access is used for complex databases, many data management tasks can be efficiently handled with robust spreadsheets. WPS Office provides a free, lightweight, and highly compatible alternative for your everyday document and data analysis needs, without the heavy interface issues of legacy database software.

  1. 1. Download the Installer: Visit the official WPS Office website and click the download button to get the free installation package.
  2. 2. Install WPS Office: Run the downloaded installer and follow the on-screen prompts to set up the software on your computer.
  3. 3. Open Your Files: Launch WPS Spreadsheets to instantly open, edit, and manage your existing Excel data files with full compatibility.
Fully compatible with Microsoft Excel (.xlsx), Word (.docx), and PowerPoint (.pptx) formats.Includes advanced Spreadsheet features and Pivot Tables for extensive data analysis.Supports VBA and macros for automating repetitive tasks without legacy UI crashes.Lightweight installation with a familiar, easy-to-use tabbed interface for seamless migration.
QA img-9

Frequently Asked Questions

Why does hiding CommandBars crash my Access database?

In modern versions of Microsoft Access, the traditional CommandBar interface has been replaced by the Ribbon UI. Forcing the application to hide all CommandBars via obsolete VBA code can leave the program without a valid user interface, causing it to freeze, crash, or fail to open files properly.

Can I run an Access database directly from a USB flash drive?

It is highly discouraged. Running a Microsoft Access application directly from a removable drive on another computer can cause stability issues, missing reference errors, and permanent file corruption. Always copy the database to a local hard drive before opening it.

Is Microsoft Access included in my Microsoft 365 Family subscription?

Microsoft Access is only included in the PC version of Microsoft 365 Personal and Family subscriptions. It is not available for Mac users. If you cannot find Access, you may need to verify your subscription details or switch to a data management alternative like advanced spreadsheets.