ExecuteExcel4Macro("GET.DOCUMENT(50)")
It doesn't seem to work correctly with Zoom property set to false.
That's as much as I can figure out. I have a one-page document with
your fit settings, and the expression returns two. If I set Zoom to
100, it returns 4 which is correct. That seems to make the
difference.
On Dec 20, 11:21 am, Shawn777
wrote:
ExecuteExcel4Macro("GET.DOCUMENT(50)")
Is suppose to provide the number of pages to be printed. I have the
following code that reprecents two pages to print it the above code says it
is just one.
Sub PrintDirect()
Sheets("DIRECT").Select
Application.Run "'RCA_RB3 06-122-S2 all crafts_rev 2 WBU
macros.xls'!Enlarge"
Application.Run "'RCA_RB3 06-122-S2 all crafts_rev 2 WBU
macros.xls'!ReduceDir"
ActiveSheet.ResetAllPageBreaks
ActiveSheet.PageSetup.PrintArea = "$B$1:$N$199"
With ActiveSheet.PageSetup
.CenterHorizontally = True
.Orientation = xlLandscape
.FitToPagesWide = 1
End With
Range("H1").Select
' MsgBox ExecuteExcel4Macro("GET.DOCUMENT(50)") & " pages will be printed."
If ExecuteExcel4Macro("GET.DOCUMENT(50)") = 1 Then
Application.Run "PrintPage"
Else
Rows("59:59").Select
Range("B59").Activate
ActiveWindow.SelectedSheets.HPageBreaks.Add Befo=ActiveCell
Application.Run "PrintPage"
End If
End Sub
This worked for me before and now it doesn't. Anyone know why?
|