hi guys,
i've got the code below that extract cell value from an excel sheet
but any idea how i continue to output it to a text file?
i'm not too sure how to do it, thanks
[CODE=perl]
use strict;
use Win32::OLE qw(in with);
use Win32::OLE::Con st 'Microsoft Excel';
$Win32::OLE::Wa rn = 3; # die on errors...
my $Excel = Win32::OLE->GetActiveObjec t('Excel.Applic ation')
|| Win32::OLE->new('Excel.App lication', 'Quit'); # get already active Excel
# application or open new
my $Book = $Excel->Workbooks->Open("C:\\DOCU MENTS\\test.xls "); # open Excel file
my $Sheet = $Book->Worksheets(1 ); # select worksheet number 1
$last_row = $sheet -> UsedRange -> Find({What => "*", SearchDirection => xlPrevious, SearchOrder => xlByRows}) -> {Row};
my $array = $Sheet->Range("A4:B$la st_row")->{'Value'}; # get the contents
$Book->Close;
[/CODE]
i've got the code below that extract cell value from an excel sheet
but any idea how i continue to output it to a text file?
i'm not too sure how to do it, thanks
[CODE=perl]
use strict;
use Win32::OLE qw(in with);
use Win32::OLE::Con st 'Microsoft Excel';
$Win32::OLE::Wa rn = 3; # die on errors...
my $Excel = Win32::OLE->GetActiveObjec t('Excel.Applic ation')
|| Win32::OLE->new('Excel.App lication', 'Quit'); # get already active Excel
# application or open new
my $Book = $Excel->Workbooks->Open("C:\\DOCU MENTS\\test.xls "); # open Excel file
my $Sheet = $Book->Worksheets(1 ); # select worksheet number 1
$last_row = $sheet -> UsedRange -> Find({What => "*", SearchDirection => xlPrevious, SearchOrder => xlByRows}) -> {Row};
my $array = $Sheet->Range("A4:B$la st_row")->{'Value'}; # get the contents
$Book->Close;
[/CODE]
Comment