in reply to Re^3: Help inserting page break in Microsoft Excel using OLE
in thread Help inserting page break in Microsoft Excel using OLE

Thank you. I did try this, although I changed the code from this:
$sheet -> HPageBreaks -> Add({Before => $ActiveCell});
to this:
$sheet -> HPageBreaks -> Add({Before => $sheet -> ActiveCell});
Still, nothing happens.

Replies are listed 'Best First'.
Re^5: Help inserting page break in Microsoft Excel using OLE
by jobs_ron (Acolyte) on Mar 01, 2005 at 23:55 UTC
    I finally figured it out! You can not replace "ActiveWindow -> SelectedSheets" with "$sheet." Instead, you use this:

    $excel -> ActiveWindow -> SelectedSheets -> HPageBreaks -> Add({Before => $sheet -> Range("6:6")}); This inserts a page break before row six. Thank you anyway to those who looked at my problem.