no $workbook->Close; in Spreadsheet::WriteExcel but in Win32::OLE?

Z

Zhidian Du

When I write a program that need the xls file immediately after
finishing writing the xls file. Why there is no $workbook->Close; to
close the current file? If I use this single program, it's ok. But
how can I let the .xls file to be used by the following programs?

I found in Win32::OLE, it has the counterpart.


Thanks.

Z. Du



#! /usr/bin/perl
use Spreadsheet::WriteExcel;
use Spreadsheet::WriteExcel::Big;


my $workbook = Spreadsheet::WriteExcel->new( "myfirstExcel.xls" );

my $worksheet = $workbook->addworksheet();
my $workformat = $workbook->addformat();

$workformat->set_bold(1);

$row = 0;
$coloumn = 0;

$workformat->set_bold( 1 );


#$workformat->set_column('A:A', 125);

#worksheet->Columns("A:A")->{ColumnWidth} = 25;

$worksheet->set_column( 'A:A', 125);
$worksheet->set_column( 'B:D', 125);


#$worksheet->write( 0, 0, "Results", $workformat );
$worksheet->write( 0, 0, "Results");

$worksheet->write( 0, 1, "Long resutl is how to seccuess" );


$workformat->set_bold();
$workformat->set_bottom(6);


$worksheet->set_column(0, 0, 12 );
$worksheet->set_column(11, 11, 12);

my $dir = "/u/dian/test";

#$workbook->SaveAs( $dir . '/perl_ole.xls');

#--------------Here it is-----------
#$workbook->Close;

print "test\n";
 
A

A. Sinan Unur

(e-mail address removed) (Zhidian Du) wrote in
When I write a program that need the xls file immediately after
finishing writing the xls file. Why there is no $workbook->Close; to
close the current file?

I do not have Spreadsheet::WriteExcel installed checking the docsquickly
reveals that there issuch a method indeed.

http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-0.42/WriteExcel.pm
#$workbook->SaveAs( $dir . '/perl_ole.xls');

On the other hand there is no mention of this method.
#$workbook->Close;

Case matters in Perl.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top