Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printing a hidden sheet


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 210
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printing a hidden sheet


Thank you all!


--
sungen99
------------------------------------------------------------------------
sungen99's Profile: http://www.excelforum.com/member.php...fo&userid=9144
View this thread: http://www.excelforum.com/showthread...hreadid=505722

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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" wrote in
message ...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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

"sungen99" wrote in
message ...

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing a hidden image SteveK14 Excel Discussion (Misc queries) 1 January 10th 09 08:11 PM
Printing hidden rows New2XL Excel Discussion (Misc queries) 0 January 30th 07 01:13 PM
I need my Hidden Rows to stay hidden when I print the sheet. Rosaliewoo Excel Discussion (Misc queries) 2 July 20th 06 07:51 PM
Printing hidden comments Tammy Excel Discussion (Misc queries) 1 May 24th 05 02:16 AM
Saving hidden data with a worksheet (preferably without using a hidden sheet) Dick Kusleika[_3_] Excel Programming 2 January 21st 04 04:39 PM


All times are GMT +1. The time now is 12:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"