>Hilmar
>
>You are right. Loxls.HPageBreaks.Add(loXls.Cells(Ln,i)) works perfectly well.
OK, great.
>I was using "ActiveWindow" instead of "ActiveSheet"
I usually keep two object references: one for the Excel object (loExcel), and one for the active sheet (loSheet). Sometimes I need the workbook which contains the sheet, but then I simply get the parent of the Sheet when I need it. The other two references, I keep throughout the entire Automation process.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)