Keith Dickens
Keith Dickens

Reputation: 11

Erroneous Sheet Objects in Excel won't delete

I had an error in my code that I have since corrected but it made a bunch of sheets objects while it was running that I didn't notice. The sheets are not simply hidden, they don't exist in the Excel frontend and can't be unhidden.

normally I just write a code like sheet15.delete and let the VBA takes care of this kind of thing for me. But these sheets can't seem to be deleted that way. I've also checked the window setting on the view tab in Excel and the unhide option is greyed out.

I've also saved the workbook as xlsx, stripping out the VBA, with intention of importing the VBA back in from backups. But before I can even inport the VBA, the sheets are listed in the VBA editor of the xlsx file. Very frustrating and weird.

Any idea how I can delete these false sheets without starting a new project and just importing the forms? too many sheeeeeets

Upvotes: 0

Views: 1245

Answers (1)

Blake
Blake

Reputation: 230

Open the VBA editor and click on one of the hidden sheets. In the VBA editor there should be a properties panel, usually under the project explorer, look at the visible property and set it to "1 - xlSheetVisible." 0 is a normal hidden sheet and 2 is a very hidden sheet. Nothing can be done to a very hidden sheet.

Upvotes: 1

Related Questions