Dear Gurus,
I want to write some data into the Excel sheet. I have written code ....can
you people guide me where i am going wrong....!
All code is working fine but data is not getting written in the result.xls
Here is the code..
==============================================
This is the Excel.pl file code
==============================================
use ExcelEdit;
use strict;
use warnings;
my $obj=new ExcelEdit();
my $worksheet=$obj->ExcelEdit::CreateSpreadSheet();
$obj->ExcelEdit::WriteRecord($worksheet,2,3,"1","YYYYY","NNNNN");
===================================================
********************************************************************************
Here is the ExcelEdit.pm code
********************************************************************************
package ExcelEdit;
use strict;
use warnings;
use Spreadsheet::WriteExcel;
sub new()
{
my $class = shift;
my $self = bless ({ }, $class);
return $self;
}
sub CreateSpreadSheet()
{
my $self=shift;
my $workbook = Spreadsheet::WriteExcel->new("results.xls");
$self->{worksheet} = $workbook->add_worksheet();
}
sub WriteRecord()
{
my $self=shift;
my $worksheet=shift;
my $rowno=shift;
my $no_of_cols=shift;
my @records = @_;
my @alphaArr=("A","B","C","D");
my $cnt = 0;
#print $worksheet."\n";
foreach my $alphabet (@alphaArr)
{
$worksheet->write("$alphabet$rowno",$records[$cnt++]);
if ($cnt > ($#records))
{
last;
}
}
}
1
********************************************************************************
Please guide me whr i am going wrong...!!
Hoping for the positive response
Thanks,
Raj.
---------------------------------
Access over 1 million songs - Yahoo! Music Unlimited.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs