G
Guest
Has anyone created HPageBreaks or VPageBreaks from their Application for Excel. I use Excel as my reporting tool for all of my Applications, and have been trying to add a new or move an existing pagebreak. But can not get code to work correctly. I have pasted some code that works up to the page break. If someone could help me or post back some code that works. Thanks
oWB = oXL.Workbooks.Add
oSheet = oWB.ActiveSheet
With oSheet
.PageSetup.PrintArea = ("a130")
.DisplayPageBreaks = True
'item = .HPageBreaks.Count()
.HPageBreaks.Add("Q30")
End With
oWB = oXL.Workbooks.Add
oSheet = oWB.ActiveSheet
With oSheet
.PageSetup.PrintArea = ("a130")
.DisplayPageBreaks = True
'item = .HPageBreaks.Count()
.HPageBreaks.Add("Q30")
End With