Recovering VBA modules from corrupt Excel workbook

sigil's solution has worked for me. Instead of steps 3-5, however, I found it safer to export the module(s) and then import them into the desired workbook. This also has the added advantage of having the macro(s) always available.

Follow these steps:

  1. Click the Start menu (Windows 7 and 8), and then type "excel /safe" in the Search box (right above Start: box has gray 'Search programs and files' text)

  2. Open the corrupted workbook

  3. Open the VBA editor (Alt+F11)

  4. Right-click on the module you want to recover and click 'Export File...'. Choose a location, type a name, and save your module. Repeat for all modules you will need.

  5. Close the corrupted workbook

  6. Create a new workbook or open the workbook in which you want to use the macro(s)

  7. Open the VBA editor (Alt+F11)

  8. Right-click on the VBA Project that has the filename of your workbook, and select Import File...'. Navigate to the exported VBA module and click Open. The module will now be a part of your workbook.