I’m working with the Office Interop and having trouble inserting page breaks in Excel. My code is working fine with the horizontal page break but I also need to set the vertical pagebreak.
Can somone modify my code below, to make a vertical page break on column I?
This code is making the correct horizontal pagebreaks but is still 150 pages long because the vertical pagebreak is not set correctly.
Dim r As Excel.Range = CType(xlWorkSheet.Cells(27, 1), Excel.Range)
r.PageBreak = 1
Try setting the vertical pagebreak for the right Column object itself, rather than the cells range.