I've never used PageBreaks. But I know that all settings concerning printing
are terribly slow - sorry, I don't know why - ask M$. A good way to speed it
up is to disable screen refreshing (even when you are executing Excel on
background). I found out that hidding columns/rows can strongly slow all
other formatting - if you want to hide any columns do it at the end of the
foramtting.
I'm using the following code, maybe it could help you
# start excel
$excel = Win32::OLE->new('Excel.Application' ) #, sub {$_[0]->Quit;})
or die "Oops, cannot start Excel";
$excel->{Visible} = 0;
# open result.dat file and set some excel properties
$excel->Workbooks->Open .........
$book = $excel->Workbooks(........... );
$sheet = $book->Worksheets(............ );
with( $excel,
ScreenUpdating => 0,
Calculation => xlCalculationManual,
ReferenceStyle => xlA1,
);
.........
.........
.........
with( $excel,
Calculation => xlCalculationAutomatic,
ScreenUpdating => 1,
Visible => 1,
);
I heard about modules Spreadsheet::ReadExcel / Spreadsheet::WriteExcel but
they don't have much formatting capabilities.
-- Petr
> -----Original Message-----
> From: Tony Bass [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 11, 2001 9:01 PM
> To: Petr Smejkal; Activeperl
> Subject: RE: Win32::OLE
>
>
> Petr,
>
> Thanks,
>
> I tried this and you're right the problem is with the win32::OLEL::const
> line. I tried your code and the program starts faster (because the line
> isn't there) but hangs for a long time when it gets to some of the lines
> like this:
>
> $Sheet->Rows($line+10)->{PageBreak} = -4135;
>
> Any ideas on this ?
>
> Is there any other way to manipulate excel other than the ole module ?
>
> Thanks,
>
> Tony
>
>
>
> At 08:45 AM 4/11/2001 +0200, Petr Smejkal wrote:
> > > use Win32::OLE qw(in with);
> > > use Win32::OLE::Const 'Microsoft Excel';
> >
> >I don't think that the cause is the first line. I'd blame the second one.
> >I'm using Win32::OLE in production and on some machines (some WinNT4) it
> >tooks a whole minute to find and import all the constants. I
> believe it can
> >take longer under certain circumstances. :)
> >
> >How to get rid of it?
> >Try to use following script to remove all the contants before
> compiling the
> >application.
> >
> >--------------remove_xlConst.pl----------------------
> >
> >use Win32::OLE::Const 'Microsoft Excel';
> >
> >while (<>) {
> > next if /OLE::Const/;
> > s/(xl[a-zA-Z0-9]+)/eval("$1")/eg;
> > print;
> >}
> >
> >----------------------------------------------------
> >
> >perl remove_xlConst.pl < myapp.pl > myapp.clean.pl
> >perlapp -f myapp.clean.pl -e=myapp.exe
> >delete myapp.clean.pl
> >
> >-- Petr Smejkal
>
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl