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

You could possibly replace $ActiveWindow->SelectedSheets with $sheet .

Not that I know anything about OLE.

  • Comment on Re^3: Help inserting page break in Microsoft Excel using OLE

Replies are listed 'Best First'.
Re^4: Help inserting page break in Microsoft Excel using OLE
by jobs_ron (Acolyte) on Mar 01, 2005 at 19:34 UTC
    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.
      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.