Remove multiple 'ThisWorkbook' modules from Excel VBA editor
Within the VBA editor, I have found duplicate instances of the 'ThisWorkbook' module seen in this screenshot:
I would like to delete these extra instances, but do not know how.
ThisWorkbook1
is now the system recognized module with all my Sheet numbers now having a 1 appended to the end of them I.e. Sheet11, 21, 31, 41, 51, 61. I have no idea how the other modules came into existence. Can anyone assist?
Solution 1:
An excel-vba Project
is hosted in a Workbook
... seeing two Workbook
objects under a single project is very worrying (and looking at the icons the VBE is using for the "ghost worksheets", it seems there's even more workbook objects than that) - I'd suggest you export all modules and copy the sane worksheet/workbook code into a new file (I wouldn't even try to open the ghost copies), and destroy that one.
Your project is most likely corrupted in some way.