How do I recover this VBA Project? Excel Error message: "Removed Part: /xl/vbaProject.bin part."

49.7k views Asked by At

I've seen related posts on other forums about this (see: http://www.mrexcel.com/forum/showthread.php?t=372534), but I've attempted everything that I've found with no success.

Here's the situation: I have a .xlsm workbook (named 'PTPro.xlsm') that contains around 2000+ lines of VBA code in a Module and 6-7 large UserForms each with their own giant chunk of code. Earlier today, I was working on the project and everything was going just fine. I saved, closed, and opened the file about 20 times total throughout the process. Never once did I receive an error message. It should be noted (in case it's important) that I was saving directly to a flash drive from Excel.

When I brought the project home this evening, I attempted to open it to make a quick change. This is when I received the following series of error messages:

  1. "Excel found unreadable content in 'G:\PTPro\PTPro.xlsm'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes."

  2. After clicking yes, a new dialog box opens with the following error message:

  3. "Excel was able to open the file by repairing or removing the unreadable content. Removed Part: /xl/vbaProject.bin part. (Visual Basic for Applications (VBA))"

  4. My only option at this stage is to click 'Close' which loads the workbook.

  5. When I hit Alt+F11 to view the VBA editor, the entire VBA project (modules, userforms, macros, etc.) is COMPLETELY GONE!!!

I've followed all of the steps that I can find, including changing the Excel defaults to enable all macros and to tring to open the file on 4 different computers (both from the hard drive and from the flash drive). The only thing that I can think of that I haven't tried yet is opening the file on the computer that I was working on today (which is a shared computer in a public computer lab, by the way). This won't be an option until Monday.

It should be noted that there are several sub-workbooks that include intermediate steps required by my application that were opened and closed frequently throughout the day, as well. They are all working just fine.

If you have ANY experience with this problem, or ANY ideas as to how I might recover the code I've written, I would be EXTREMELY grateful!!!

THANK YOU!!!

5

There are 5 answers

0
indrap On BEST ANSWER

I have similar problem when i try to run my VBA script inside client PC.

The problem is because the client PC doesn't install Microsoft Office Visual Basic Application. By running office setup then add Visual Basic Application Feature, the script successfully running.

0
Damian Fronc On

My friend said that you have change in Registry Editor HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Common\VBAOff. In the "Value data" box, make the change from 1 to 0 or press the delete key (click the right mouse button and click Delete). Exit Registry Editor.

0
thomas On

The problem is because the client PC doesn't install Microsoft Office Visual Basic Application

Right answer. Select Run all from my computer for the Office Tools category in setup menu.

Developers... Was it so hard to find a better error message ?

0
Vivek Amilkanthawar On

Check if the Language settings on your pc are the same required for running macro.

Macro might have special characters written in it and thus the primary input language of your PC should the same as that of Micro.

In my case macro was written in Japan having few Japanese characters in it and primary input language of my PC was English (India). Removing it and keeping only Japanese solved my problem.

0
Karl On

! i got to solve this problem for my xlsm-files !

the VBA-code was written on my mac an there i (since i am from Germany) put some "ä" "ö" and "ü" (so special signs) in some of the Userform-names. Now the Excel 2010 on Windows could not read these signs and the file got corrupted. Solvation: i have replaced all special signs (like "ä", "ß", "ü", ...) with standard ones and e voila -> everything worked fine.

Hope this helps you as it helps me right now!

I had really had to laugh hard about such an dumb bug and this inconsistency between the OS.