+ Reply to Thread
Results 1 to 5 of 5

VBA/macro to unhide a sheet?

  1. #1
    Registered User
    Join Date
    07-31-2008
    Location
    Denmark
    Posts
    31

    VBA/macro to unhide a sheet?

    Hi everyone here,

    I'm having a challenge with a spreadsheet that puzzles me:

    I'm using this quite simple code to hide one of the spreadsheets (named "Ark2"). It written directly in a module as a subprocedure and there's no more code than this:

    -------------

    Please Login or Register  to view this content.
    -------------

    The MsgBox "Object library invalid or contains references to object definitions that could not be found" pops up.... Any idea what can be wrong?? Also I can't record a macro that hides or makes the sheet visible ...

    When I do the same in another (new) spreadsheet it works???

    Help appreciated

    Best regards,

    Jesper
    Last edited by shg; 11-15-2008 at 12:43 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    I've edited your post to add code tags. Please edit it yourself to see how, and use them in the future.

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480
    The code is even simpler than you think
    Please Login or Register  to view this content.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434
    Any reason why you are going through the vbe object to hide stuff?

    If the code is in the same workbook as the one with the sheet that needs hiding how about,

    Please Login or Register  to view this content.
    The macro will probably work if you hide the sheet using menus in Excel rather than by setting project properties in the VBE
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    07-31-2008
    Location
    Denmark
    Posts
    31
    Thanks all for suggestions. I found out what the problem was: I happened to save person.xls as an actual workbook and somehow it caused the vba code to not work. I haven't yet tried your suggestions but will be doing so shortly.

    Enjoy your day Jesper

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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