I am running an Access 97 program. To create Horizontal page breaks on an excel spreadsheet. My original code caused a runtime error -2147417851. I went through the archives and I found an interesting solution but now I am getting a runtime error 1004. Any help is appreciated.
Currently iRow = 45 so I know the error is not because of a null.
Tom
Original code
Current Code
Currently iRow = 45 so I know the error is not because of a null.
Tom
Original code
Code:
If (iPageBreakCount = 4) Then
With goXL.Sheets("AR Report-Aging")
.Cells((iRow - 1), 1).Select
.HPageBreaks.Add Before:=ActiveCell
End With
iPageBreakCount = 0
Current Code
Code:
If (iPageBreakCount = 4) Then
With goXL.Sheets("AR Report-Aging")
ActiveWindow.SelectedSheets.HPageBreaks.Add _
Before:=Cells(iRow - 1)
End With
iPageBreakCount = 0