VBA project is corrupt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Arkadiy Skalrud
    New Member
    • Nov 2011
    • 1

    VBA project is corrupt

    When I'm trying to open my Access 2003 database - I receive this error:
    "The Visual Basic for Applications Project in the database is corrupt."

    Please let me know if there is any way to recover the VBA codes from the application's module.
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    You could try a compact and repair on the database first.

    In my experience of this type of problem if compact and repair does not resolve it then it is unlikely that other approaches (such as trying to import the module into another database) will be successful, in which case restoring a known-good copy from a recent backup is required.

    -Stewart

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32633

      #3
      If you can open the code then I would try copying it out and pasting it back in again (then recompiling).

      Each purely code module can be deleted and recreated but any object modules must be set back to (essentially) empty as deleting the object has more ramifications than just deleting the code.

      If you can't see the code even, then you should have included that information in the question (You should have explained anyway to be honest).

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Try Decompiling/Compile/Compact the Database before you do anything:
        1. Execute the following, or create the following Shortcut (depending on Version):
          Code:
          C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE /decompile
        2. From Access, Open the Database you want to Decompile.
        3. Open up any Module, Compile it, then Save it.
        4. Go back to the Database and Compact it.

        Comment

        • OldBirdman
          Contributor
          • Mar 2007
          • 675

          #5
          You could try Microsoft's undocumented utility: Jet Compact Utility. This is described at http://office.microsoft.com/en-us/ac...570.aspx?CTT=1
          This has worked for me when I could not otherwise open a 2003 database.

          Comment

          Working...