You could eliminate a step if you are exporting to csv, and then opening in Excel by just writing the data out to excel in the first place, especially if you choose to use the Win32::OLE module, which is, as was stated before, the most powerful choice when dealing with Excel on the Win32 platform.
Either way, here is an example (taken from a tutorial in progress on my scratchpad) of opening a file.
use strict;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';
$Win32::OLE::Warn = 3; # Die on Errors.
########################################
## ::Warn = 2; throws the errors, but ##
## expects that the programmer deals ##
########################################
my $excelfile = 'somefile.csv';
###################################################################
## First, we need an excel object to work with, so if there isn't##
## an open one, we create a new one, and we define how the object##
## is going to exit ##
###################################################################
my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
|| Win32::OLE->new('Excel.Application', 'Quit');
my $Book = $Excel->Workbooks->Open($excelfile);
Now you could just add a blank Workbook by replaceing the ->Open($excelfile) line with
my $Book = $Excel->Workbooks->Add();
and cycle through your data and enter it directly into excel (an exercise I use leave for the reader, though there is a good example of it in the tutorial mentioned above).
C-.
|