7

I have sheets listed in an Excel Workbook that don't actually exist. The sheets are listed when you view code and are looking at the list of sheets in the VBA part, but they don't actually exist in the workbook at all. They also aren't hidden, in case someone is thinking of that.

These sheets also don't have a name after them in parentheses and look like the same icon as ThisWorkbook. I have no way to delete them and have been trying. Does anyone have any suggestions on how to delete them from the VBA portion? Remember, these sheets don't actually exist so it's not like I can just right click on them within Excel and select Delete. I did try right clicking on the sheet in VBA and select Remove Sheet, but that option is greyed out. Actually remove sheet is greyed out on all sheets, even those that do exist. The spreadsheet is not protected in any way either.

These sheets aren't causing any issues, more of an annoyance since I know they aren't physically there and I have no way to remove them from VBA.I have attached a picture of what I am looking at. The sheets that I am trying to remove are Sheet10, Sheet11, and Sheet9.

enter image description here

1
  • It seems that we need to know how to recreate the problem in order to know how to solve it... but probably recreating the problem will use the same property as will be used to solve it!
    – Gallus
    Sep 16, 2016 at 13:06

4 Answers 4

3

I had that same situation once. The only solution I found was to copy all of the "real" worksheets to a new workbook. I'm guessing the original workbook got corrupted somehow.

3
  • I was afraid of that, I was thinking of that too. I was hoping someone else had further suggestions. Thanks.
    – Chris
    Jun 30, 2014 at 20:25
  • 1
    @Chris I just noted another similarity between your problem and mine. Look at the icon next to the errant worksheets. It is a workbook icon, not a worksheet icon. Jul 5, 2014 at 15:42
  • Hi Ron, Yeah I noticed that. I mentioned that in my original question. I thought that was odd too. Well, it's good to know that is what happened to you too. I guess the only solution is to recreate, which I figured before I posted the question, but was hoping someone might have an easier or better solution. Thanks for the post.
    – Chris
    Jul 5, 2014 at 16:44
2

I solved a problem like this doing the next steps:

  1. Backup your file in other place
  2. Change the extension .xlsm to .zip
  3. Extract the zip file
  4. Go to /xl folder
  5. Open workbook.xml in notepad
  6. In some place there was each "gost" Sheet with the parameter hidden. Replace full command parameter by nothing (I don't remember the structure. Something like 'state:"hidden"'. Erase all of this)
  7. Compact all files and folders extracted as ZIP.
  8. Rename the zip file as .xlsm
  9. Open and see if it's resolved
-1

I know this is an old post, but I found the solution. if you look at the properties of the 'Phantom' sheet you will notice its 'visible' property is 2 - xlSheetVeryHiddden. Just change that property to -1 - xlsheetVisible and you will be able to delete it.

1
  • The errant items are workbooks, not worksheets and this option is not available for workbooks... that's a handy tip for the future to completely lock down a worksheet from prying fingers...
    – Gallus
    Sep 16, 2016 at 13:05
-1

There is an easier way.... Right-click on one of the current tabs and select 'Unhide'. This will display a list of all your 'hidden' tabs. Unhide them, then delete them. Once deleted, they will be removed from the VBAProject list.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.