[]
Adds a horizontal page break within the print area.
The new page break is inserted above the specified range. Use HPageBreaks to access the collection of horizontal page breaks for a worksheet.
IHPageBreak Add(IRange Before)
Function Add(Before As IRange) As IHPageBreak
| Type | Name | Description |
|---|---|---|
| IRange | Before | The range above which the new page break will be added. |
| Type | Description |
|---|---|
| IHPageBreak | The new IHPageBreak object. |
worksheet.Range["A1:B5"].Value = new object[,] {
{"Name", "Value"}, {"A", 100}, {"B", 200}, {"C", 300}, {"D", 400}
});
IRange before = worksheet.Range["A4"];
IHPageBreak pageBreak = worksheet.HPageBreaks.Add(before);