5uper BonBon
5uper BonBon

Reputation: 23

Delete VBA module

I was deleting an Access Object (a report) and Access crashed during the delete.

The object no longer exists in Access, but its module still shows up in VBA like a ghost.

If I click on it, I get a FILE NOT FOUND error.

If I try to compact & repair or compile the database, I get a FILE NOT FOUND error.

How can I solve this problem?

Upvotes: 2

Views: 1287

Answers (3)

TinMan
TinMan

Reputation: 7759

There are some great answers here. I just wanted to give a shout out to MZ Tools Clean Project feature. It will export all your code modules, delete them and then import them back. This fixes a lot of strange behavior that we encounter across all the MS Office applications that use VBA. It's also packed full of other features.

MZ Tools

Upvotes: 0

Duncan Drake
Duncan Drake

Reputation: 228

you write you tried compile already and it did not work.

Did you try decompile first though?

First of all make a backup copy (but am sure you already did that :) )

With Access and your access file closed type from the command prompt: C:\yourOfficeInstallPath\MSACCESS.EXE /decompile

Access will start. Click File > Open and select the database you want to decompile Open any module and click Debug > Compile

Then save your file and close.

Open again your file and compact it.

Let me know if it solved it.

Upvotes: 2

KySoto
KySoto

Reputation: 428

A potential option is to create a new database file, and import all of the content from the old database file. that will clear out the funky ghost stuff.

Upvotes: 2

Related Questions