tags:

views:

121

answers:

1

I am working with the office interop and am 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 My code is below can someone modify it to make a vertical page break on column "I" this code is making the correct horizontal pagebreak but is still 150 pages long because the vertical pagebreak is not set correctly. Thanks in advance.

Dim r As Excel.Range = CType(xlWorkSheet.Cells(27, 1), Excel.Range)

    r.PageBreak = 1
A: 

Try setting the vertical pagebreak for the right Column object itself, rather than the cells range.

M.A. Hanin
can you give me an example on how to do that?
Nick LaMarca
something like:Dim theColumn As Excel.Range = theWorksheet.Columns(1)theColumn.PageBreak = Excel.XlPageBreak.xlPageBreakManual
M.A. Hanin