View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Frank M.[_2_] Frank M.[_2_] is offline
external usenet poster
 
Posts: 2
Default How to avoid several print areas being squeezed into one page

In a reporting application I am building a single sheet with many different
print areas as a report. However, when I choose printout all of the areas
are presented on a single with the zoom factor set very low (like 5%).

I cannot find a way to make this behaviour stop. Is it a general setting or
is it something I can control through the code.

It should be mentionened that my spreadsheet is embedded as an OLE object in
a VB form. Thus I do not have access to the full object model of Excel but
only the single sheet in the workbook:

Dim shPrint As Object ' extra ref to the Worksheet object in the OLE
object container that we will work with
Dim sPrtAreaAdr As String

Set shPrint = OLE_keyfig(5).object.Sheets(1)

shPrint.Range("A202:J1200").Value = ""

' Setting a range to to a prepared array
shPrint.Range("A201:J" & CStr(201 + UBound(arrKortXL, 1))).Value =
arrKortXL

Dim iKort As Integer

' This is an effort to stop display in one page by defining separate
print area entries in the range string
Do While iKort < UBound(arrKortXL, 1):
sPrtAreaAdr = sPrtAreaAdr & ",A" & CStr(200 + iKort) & ":J" &
CStr(200 + iKort + 79)
iKort = iKort + 80
Loop

shPrint.PageSetup.PrintArea = sPrtAreaAdr
shPrint.PrintOut Preview:=True

The above still produces one printout page in the preview with the zoom set
to a very low figure. I want a new page per 80 lines. I could define each 80
lines separately and printout right away before defining the next, but then
my footer with page number and total number of pages won't make any sense.

Hope that someone can help.


With kind regards,




Frank M.