Don't I feel like a sap? Thank you. Here is the new code:
use warnings;
use strict;
use OLE;
use Win32::OLE::Const 'Microsoft Excel';
my $excel = CreateObject OLE 'Excel.Application';
my $workbook = $excel -> Workbooks -> Add;
my $sheet = $workbook -> Worksheets("Sheet1");
$sheet -> Activate();
$sheet -> Range("6:6") -> Activate();
$sheet -> HPageBreaks -> Add(Before => $sheet -> ActiveCell);
Now there is no error message, but still no page break. |