Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cant set pagebreaks in access 2003

Status
Not open for further replies.

vba317

Programmer
Mar 5, 2009
708
US
I am trying to set pagebreaks in access to create an excel spreadsheet I keep on getting a error 438. Help would be appreciated.

Code:
With goXL.ActiveSheet.PageSetup
        .LeftMargin = goXL.Application.InchesToPoints(0.25)
        .RightMargin = goXL.Application.InchesToPoints(0.25)
        .TopMargin = goXL.Application.InchesToPoints(0.5)
        .BottomMargin = goXL.Application.InchesToPoints(0.5)
        .HeaderMargin = goXL.Application.InchesToPoints(0.25)
        .FooterMargin = goXL.Application.InchesToPoints(0.25)
        .LeftHeader = "Anesthetic Solutions, P.C."
        .LeftFooter = Format(dtmDate, "dddd, mmmm dd, yyyy")
        .RightFooter = "Pages " & "&P"
        .Orientation = xlLandscape
        .FitToPagesWide = 1
        .PrintTitleRows = ("A1" & ":" & "A2")
        .PrintArea = "A1:P" & iEndRow
            For iPageBreak = 27 To iEndRow
          [Red] PageBreak = goXL.Application.ActiveSheet = iPageBreak[/Red]
                iPageBreak = iPageBreak + 27
            Next iPageBreak
    End With
 
Hi,

PageBreak is an Excel object and needs an appropriate reference in your code to an Excel sheet and range.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top