When opening an Access database file in a different Access version or on a different system, you may encounter the “Access database cannot be opened because the VBA project contained in it cannot be read.”
The complete error message reads as follows:
“The database cannot be opened because the VBA project contained in it cannot be read. The database can be opened only if the VBA project is first deleted. Deleting the VBA project removes all code from modules, forms, and reports. You should back up your database before attempting to open the database and delete the VBA project.”
The cause of the error may vary depending on the Access version. Below we’ll be discussing the causes that may lead to this error and the possible solutions to resolve it.
Causes of “Access Database cannot be Opened because the VBA Project Contained in it cannot be Read” Error
Some possible reasons for this error are:
- Corrupted database file
- Incorrect Windows Registry settings
- Opening the higher version (ACCDE) files in a lower Access version.
- Problem with the latest updates of Microsoft Office
Methods to Fix Access Database cannot be Opened Error
Following are some methods you can try to fix the Access database cannot be opened error:
Method 1: Compile the Database
You can compile the database to fix the VBA-related errors. Microsoft Access does not always compile every part of your database whenever you use it. It compiles what it requires and sometimes, pieces of that can get corrupted.
To compile your database, follow these steps:
Note: Take a backup of your database before proceeding.
- Open your Microsoft Access.
- Go to Create > Visual Basic.
- In the Microsoft Visual Basic for Applications window, click Debug > Compile Database.
After compiling, if you still get the error, you can try decompiling the database.
Here are the steps to decompile the database:
- Open Command Prompt.
- Type “C:\Program Files\Microsoft Office\root\Office16\MSACCESS.EXE” /decompile “C:\FullPath\MyDatabase.ACCDB”
- Press Enter.
Method 2: Recreate Database Files
Some users have reported encountering this error when opening the ACCDE/MDE files (of Access 2010 SP1 version) with 64-bit versions of MS Access (initial release or RTM). They’re able to fix the error by recreating the database files from their source databases.
Method 3-Change File Name Extensions
Sometimes the “Access database cannot be opened because the VBA project contained in it cannot be read” error can occur due to outdated built-in wizard files. You can fix the error by changing the file name extensions using the below steps:
- Close all instances of Microsoft Access.
- Open the File Explorer window.
- Click the View ribbon and then click the File name Extensions checkbox in the show/hide group.
- Go to :\Program Files\Microsoft Office\Office14\ACCWIZ\.
- Find the below files and rename them to (<filename>.old extension)
Original File Name Rename To
Acwzmain.accde Acwzmain.old
Acwzlib.accde Acwzlib.old
Acwztool.accde Acwztool.old
Utility.accda Utility.old
Method 4: Repair the Database
You may also encounter the “Access database cannot be opened” error if the database file is corrupt. You can repair the Access database using the Compact and Repair utility in MS Access. Here are the steps:
- Open Microsoft Access.
- Go to File > Info > Compact & Repair Database.
If the Compact and Repair utility fails to repair the corrupted database, then you can try an advanced Access repair software, such as Stellar Repair for Access. It is a reliable tool that can help fix the errors that occur due to corrupt database files. It can repair both ACCDB and MDB files. Moreover, it can recover all the components from the damaged database with 100% integrity.
Conclusion
The error “Access database cannot be opened because the VBA project contained in it cannot be read” may occur due to several reasons. In this blog, we’ve outlined the common reasons behind the Access database error. Also, we’ve mentioned the possible methods to fix the error. If the database is corrupt, you can use the Compact and Repair utility in MS Access. If it doesn’t work, use a professional Access repair software, such as Stellar Repair for Access. This tool can easily repair severely corrupted MDD/ACCDB files and recover all the data.
Was this article helpful?