+ Reply to Thread
Results 1 to 6 of 6

Printing a hidden sheet

  1. #1
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Printing a hidden sheet

    The below macro works just fine when the worksheet is not hidden. But when it is the macro bombs out.

    I think its because It's trying to go to the Print Ticket woorksheet right?


    Sub Button11_Click()
    Sheets("Print Ticket").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Sheets("Form").Select
    Range("E9:F9").Select
    End Sub

  2. #2
    galimi
    Guest

    RE: Printing a hidden sheet

    Sheets("Print Ticket").PrintOut Copies:=1, Collate:=True

    This line alone should do the trick
    --
    http://HelpExcel.com
    1-888-INGENIO
    1-888-464-3646
    x0197758


    "sungen99" wrote:

    >
    > The below macro works just fine when the worksheet is not hidden. But
    > when it is the macro bombs out.
    >
    >
    >
    >
    > Sub Button11_Click()
    > Sheets("Print Ticket").Select
    > ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    > Sheets("Form").Select
    > Range("E9:F9").Select
    > End Sub
    >
    >
    > --
    > sungen99
    > ------------------------------------------------------------------------
    > sungen99's Profile: http://www.excelforum.com/member.php...fo&userid=9144
    > View this thread: http://www.excelforum.com/showthread...hreadid=505722
    >
    >


  3. #3
    glyn
    Guest

    RE: Printing a hidden sheet



    "sungen99" wrote:

    >
    > The below macro works just fine when the worksheet is not hidden. But
    > when it is the macro bombs out.
    >
    >
    >
    >
    > Sub Button11_Click()
    > Sheets("Print Ticket").Select
    > ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    > Sheets("Form").Select
    > Range("E9:F9").Select
    > End Sub
    >
    >
    > --
    > sungen99
    > ------------------------------------------------------------------------
    > sungen99's Profile: http://www.excelforum.com/member.php...fo&userid=9144
    > View this thread: http://www.excelforum.com/showthread...hreadid=505722
    >
    >


    try unhiding the sheet whilst it is printed and then hiding it again

    E.g

    Sub Button11_Click()
    sheets("print ticket").visible = xlsheetvisible
    Sheets("Print Ticket").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    sheets("print ticket").visible = xlsheetveryhidden
    Sheets("Form").Select
    Range("E9:F9").Select
    End Sub

    hope this helps



  4. #4
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651
    Thank you all!

  5. #5
    Norman Jones
    Guest

    Re: Printing a hidden sheet

    Hi Sungeri,

    Try removing the selection:

    Sub Button11_Click()
    Sheets("Print Ticket")..PrintOut Copies:=1, Collate:=True
    End Sub

    Selections are rarely necessary and are often inefficient.

    ---
    Regards,
    Norman



    "sungen99" <[email protected]> wrote in
    message news:[email protected]...
    >
    > The below macro works just fine when the worksheet is not hidden. But
    > when it is the macro bombs out.
    >
    >
    >
    >
    > Sub Button11_Click()
    > Sheets("Print Ticket").Select
    > ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    > Sheets("Form").Select
    > Range("E9:F9").Select
    > End Sub
    >
    >
    > --
    > sungen99
    > ------------------------------------------------------------------------
    > sungen99's Profile:
    > http://www.excelforum.com/member.php...fo&userid=9144
    > View this thread: http://www.excelforum.com/showthread...hreadid=505722
    >




  6. #6
    Don Guillett
    Guest

    Re: Printing a hidden sheet

    try this from anywhere in the workbook. Selections are NOT necessary.

    Sub printhiddensheet()
    Application.ScreenUpdating = False
    With Sheets("sheet8")
    .Visible = True
    .PrintOut
    .Visible = False
    End With
    Application.ScreenUpdating = True
    End Sub

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "sungen99" <[email protected]> wrote in
    message news:[email protected]...
    >
    > The below macro works just fine when the worksheet is not hidden. But
    > when it is the macro bombs out.
    >
    >
    >
    >
    > Sub Button11_Click()
    > Sheets("Print Ticket").Select
    > ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    > Sheets("Form").Select
    > Range("E9:F9").Select
    > End Sub
    >
    >
    > --
    > sungen99
    > ------------------------------------------------------------------------
    > sungen99's Profile:
    > http://www.excelforum.com/member.php...fo&userid=9144
    > View this thread: http://www.excelforum.com/showthread...hreadid=505722
    >




+ 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