+ Reply to Thread
Results 1 to 4 of 4

Print macro erroring if there are hidden sheets

  1. #1
    Registered User
    Join Date
    08-11-2011
    Location
    Blanchard, Oklahoma
    MS-Off Ver
    Excel 2010
    Posts
    10

    Print macro erroring if there are hidden sheets

    Hi... i have a macro within a workbook that should select certain sheets within the workbook and print them if they meet the criteria. It is linked to a "PRINT" button in the first sheet. It works fine, unless there are hidden sheets within the workbook, then it returns "RTE 1004: PrintOut method of Sheets class failed"
    If any one can help me figure out how to fix this that would be appreciated. I attached the workbook with 2 hidden sheets in it.
    Thanks
    Attached Files Attached Files
    Last edited by davidjoe; 02-03-2012 at 03:48 PM. Reason: Solved

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Print macro erroring if there are hidden sheets

    Let's add one more loop to make sure it only applies to visible sheets:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-11-2011
    Location
    Blanchard, Oklahoma
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Print macro erroring if there are hidden sheets

    That works great... Looks like that will be the best option since I don't need to print anything on the hidden sheets.
    Thanks for the help JBeaucaire

  4. #4
    Registered User
    Join Date
    08-11-2011
    Location
    Blanchard, Oklahoma
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Print macro erroring if there are hidden sheets

    Sorry JBeaucaire... it won't let me add to your reputation on this one because this is only my second post and i added reputation on the first one

+ 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