Printing Anomaly

O

Otto Moehrbach

Excel 2002, WinXP
I'm printing from a number of sheets and placing the print code within a
With/End With construct. With each sheet I need the printed page sequence
to be the last page first, so I'm using the Excel4 code as follows:
Sub PrintBwd()
With Sheets("PrintLtr")
.PageSetup.PrintArea = RngToPrint.Address
NumPages = ExecuteExcel4Macro("GET.DOCUMENT(50)")
For Page = NumPages To 1 Step -1
.PrintOut from:=Page, To:=Page
Next Page
End With
End Sub

I'm getting erratic printing output which appears to be driven by which
sheet is the active sheet. Specifically, the printing output is one or two
pages short except when the sheeet to be printed is the active sheet. I
have checked and re-checked my code and it all appears to be proper. The
only wild card for me is the Excel4Macro about which I know nothing other
than how to use it.
My question: What sheet does the Excel4 macro operate on?
Thanks for your help and time. Otto
 
D

Dave Peterson

You could just activate that sheet and be happy <bg>.

or...

NumPages = ExecuteExcel4Macro("get.document(50,""" & .Name & """)")
 
O

Otto Moehrbach

Dave
You have come through again. I was looking at activating each sheet in
turn and my OP has some 160 sheets. Thanks for your help and your time.
Otto
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top