+ Reply to Thread
Results 1 to 6 of 6

Orphan Sheets in MS Excel Object folder

  1. #1
    Registered User
    Join Date
    01-24-2012
    Location
    Argentina
    MS-Off Ver
    Excel 2007
    Posts
    4

    Orphan Sheets in MS Excel Object folder

    Every now and then after creating and removing sheets with VBA code, there are orphan sheets that have no name and have the icon of "ThisWorkbook" object. When selecting them, you see the properties of "ThisWorkbook" object.

    They are not in the Sheets() object and I can't erase them.

    I attache a pic of what I see. Sheets from 13 to 18 and 20... they are unaccessible from code. I want to delete them.

    OrphanSheets.jpg
    Last edited by juanjoaliag; 01-24-2012 at 06:31 PM.

  2. #2
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Orphan Sheets in MS Excel Object folder

    These sheets Visible property is not set to xlSheetVeryHidden? Youu cannot unhide them from the worksheets? Can you post a workbook with an example?
    Hope this helps.
    Anthony
    Pack my box with five dozen liquor jugs
    PS: Remember to mark your questions as Solved once you are satisfied. Please rate the answer(s) by selecting the Star in the lower left next to the Triangle. It is appreciated?

  3. #3
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Orphan Sheets in MS Excel Object folder

    Hi,
    Do the sheets disappear when you close and reopen the workbook? If so, do you have any COM addins loaded?
    Good luck.

  4. #4
    Registered User
    Join Date
    01-24-2012
    Location
    Argentina
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Orphan Sheets in MS Excel Object folder

    Here is the file. I tryed to make it smaller by erasing the code and the data but I couldn't.
    They don't disapear when I close and reopen the file.

    You will see that when you double click them they have code in them.

    There are like 5 base sheets. When I want to load a new case, when I hit the "New case" button, VBA would unhide NewCase Sheet, duplicate it and then Hide it again.

    When I loaded all the fields in the case and I hit save and close, VBA loads the case in Database sheet and then deletes this duplicated NewCase Sheet...

    Database Project - Copy.xlsm
    Last edited by juanjoaliag; 01-24-2012 at 08:06 PM.

  5. #5
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Orphan Sheets in MS Excel Object folder

    I think you workbook is corrupt. I think to try and fix this would be almost impossible - I changed the name of ThisWorkbook to e.g. acv and then all the sheets marked as workbooks became named acv. My advice would be to take all the code out of thisworkbook and place it into modules and only keep worksheet event code in worksheets and thisworkbook code in this workbook and remove all the code for your buttons into modules. How this has occurred I have no idea - I have read a few posts from people who have reported a similar problem (they are few in number) and the final result is to start a new workbook and copy out your sheets and redesign so only worksheet and thisworkbook code is confined to them respectively and place all the button code into modules.
    As to how to replicate the problem I have no idea however somewhere along the line the workbook has been corrupted and the fastest way to resolve this is to start a new workbook and redesign where you place your code. Best answer I have.
    Will be interested if someone else can shed more light on this.
    PS: I am intrigued as to how ThisWorkbook code has been split between different orphan sheets - it is not even the same code in each orphan. Very weird.

  6. #6
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Orphan Sheets in MS Excel Object folder

    I have not had time to examine the structure of the XML file but the first thing I notice in the code is that you are using ADO to query the workbook while it is open. That is not recommended due to known memory leak issues and may be the root cause (or one of them) of your issues.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1