Re: Perl and Excel

2004-06-25 Thread James Edward Gray II
On Jun 25, 2004, at 10:44 AM, Naser Ali wrote:
Hello All,
Is there a way to move data from flat file to Excel spread sheet using 
perl?
Definitely.  Take a trip over to the CPAN.  You're looking for the 
module, Spreadsheet::WriteExcel.

Or, sometimes when I'm in a hurry and I don't need formatting, I just 
spit out a CSV file.  Excel reads those just fine.

Good luck.
James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Perl and Excel

2004-06-25 Thread Naser Ali
Hello All,
 
Is there a way to move data from flat file to Excel spread sheet using perl?
 
Thanks


Perl and Excel Graph Problem !

2002-10-18 Thread Mark Wildey
Hi There

I have a script that takes a MS Access database and places a table into an
Excel spreadsheet. Once the data is in Excel I want to generate a graph.

All goes well in that the graph is generated, using the correct data and
style, the graph title but the “PlotBy => xlColumns” is not honored. Rather
the graph is picking up the default of rows !!


Can anyone advise why this might me so ?


Regards

Mark

Extract of script….


use Win32::ODBC;
use Win32::OLE qw(with);
use Win32::OLE::Const;
use Win32::OLE::Const 'Microsoft Excel';


#
# Change the format of the cells to get the correct date format
#
$sheet->Cells(1,1)->{Value} = " " ;
$sheet->Range("B1:" . chr(65+$numCols) . "1")->{NumberFormat} = "mmm" ;

#
# This next section will graph the results
#

$ChartCells = "A1:" . chr(65+$numCols) . ($rowCounter-1) ;

my $Range = $xl_app->ActiveSheet->Range($ChartCells)->Select;

$Chart = $xl_app->Charts->Add ;
$Chart->{ChartType} = xlColumnStacked  ;
$Chart->SetSourceData({Source => $Range, PlotBy => xlColumns}) ;
$Chart->Location({Where=>xlLocationAsNewSheet, Name=>"My Graph Title"})  ;

#
# On our way out save the Excel file and close the database
#

$db->Close();
$book->SaveAs( 'C:\\perlSrc\\test1.xls' );

undef $book;
undef $xl_app;