File Corruption & Recovery

Fix a VBA Project Error When Opening a Microsoft Access Database

Tauseeq MagsiTauseeq Magsi Nov 22, 2026 868 views

Question details

The user needs to recover an Access database without losing its VBA code and other objects.

Fix a VBA Project Error When Opening a Microsoft Access Database
Product
Microsoft Access
Device & OS
not provided
Scenario
Opening an Access database that contains VBA code, queries, forms, reports, and other objects.
Observed behavior
Access says the VBA project cannot be read and offers to delete it. Deleting the project could remove code, and other database objects may also be damaged.
Before you start

Locate the most recent working copy of the database and use a separate copy for recovery attempts. Do not accept the prompt to delete the VBA project if you need to preserve its code.

Solution 1Recommended

Import recoverable objects into a new Access database

Use a working copy or a copy of the affected database to transfer objects into a clean file, then rebuild anything that cannot be imported.

1
Create a blank database

In Access, select File > New > Blank database, enter a file name, and select Create.

2
Choose the source database

Open the External Data tab and choose New Data Source > From Database > Access. Browse to a working copy of the original database, or a copy of the affected file if no working copy is available, and choose to import objects into the current database.

3
Import the objects

In the Import Objects dialog, select the needed tables, queries, forms, reports, macros, and modules on their respective tabs, then select OK. If an import fails, try importing objects in smaller groups to identify damaged items.

4
Check and rebuild

Open the imported objects from the Navigation Pane and test their behavior. Recreate any damaged or missing queries, forms, reports, or code from a working copy or other available source.

Import recoverable objects into a new Access database
Recovery may be incomplete: Importing objects does not guarantee recovery of damaged VBA code or other corrupted objects. Contact an Access specialist if the database contains critical information or important objects cannot be recovered.
Free Microsoft Office alternative

Work with exported database data in WPS Office

WPS Office is a free, lightweight Office alternative with a familiar interface and support for common Microsoft Office formats, making it easy to move exported data into spreadsheets. It does not repair Access databases or replace Access VBA.

Review and analyze exported Access data in WPS SpreadsheetsOpen and edit Microsoft Excel .xlsx and Word .docx filesUse a familiar interface for an easier transition from Microsoft OfficeWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Should I let Access delete the unreadable VBA project?

Avoid choosing Delete if you need the code. Deleting the project can remove code from modules, forms, and reports. Instead, attempt recovery using a copy of the database.

Where can I import objects into a new Access database?

In the new database, go to External Data > New Data Source > From Database > Access. Select the source file and choose to import objects into the current database.

What if some queries or modules will not import?

Try selecting smaller groups of objects in the Import Objects dialog to identify the damaged items. Recreate them from a working copy or other available source if they cannot be imported.

Can WPS Office repair an Access VBA project?

No. WPS Office does not repair Access databases or Access VBA. It can open compatible spreadsheet files if you export recoverable data from Access for analysis.