Have Questions? 
help@excelvbaisfun.com
Excel Ninja Pro
All Access

June 15, 2020

Extra Sheets In Excel VBA - Corrupt Excel Workbook Help

If you've ever encountered a corrupt Excel workbook, you've probably tried lots of things already, including possibly tearing your hair out.

In this particular scenario, we have lots of extra sheets that show up in the Visual Basic Editor. This is not great.

…and it may have an extra ThisWorkbook object too!

It looks like some sheet objects have no CodeName in parenthesis, others do. Some sheets have a bunch of extra properties in the properties window!

Oh, and macros won't work anymore...

Here's what I tried:

  • VBA Code Cleaner (free)
  • saving as an .xlsb file
  • Compiling the code to check for syntax errors (none)
  • other weird stuff suggested by blog posts...

Finally, here's what worked:

  1. Save your macros/ Userforms, etc by exporting them or just copying the code you need into a Word/Text document.
  2. Save the workbook as a regular .XLSX file.
  3. Close the current file
  4. Re-open the new .XLSX file to reveal the sheets are restored to normal and the duplicates are gone!
  5. Now you'll need to re-add your code by importing the modules (.bas files) and Userforms OR just copy in your codes.
  6. FIXED!

Watch the full video here:

Excel VBA Is Fun

We believe Excel is one of the most versatile programs out there - and learning to program and automate it makes you very valuable!

You can prevent wasted time and errors, speed up tasks and become indispensable to your organization. 

See how our trainees have gotten raises, promotions and bonuses using their Excel Automation skills while building real problem-solving programs in Excel!
LEARN MORE
Copyright © 2024 ExcelVbaIsFun
X

Forgot Password?

Join Us

0
    0
    Your Cart
    Your cart is emptyReturn to Shop
    linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram