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

What would $ActiveWindow be defined as?
  • Comment on Re^2: Help inserting page break in Microsoft Excel using OLE

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