Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] XLS in Linux ?!

Expand Messages
  • vakeel ahmad
    You can use Spreadsheet::WriteExcel module for this. vakeel. ... __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS
    Message 1 of 3 , Mar 30, 2003
    • 0 Attachment
      You can use Spreadsheet::WriteExcel module for this.

      vakeel.


      --- Jadi <jadi@...> wrote:
      > Hi there friends,
      >
      > Here is my problem : I have a boss who uses Excel as
      > his
      > DB. haha... How can I open/read/write a XLS file in
      > Perl under Linux ?
      > I searched the docs and find a code which works
      > corrcet under
      > WinXP (Active Perl) but How can I use this code in
      > Linux ? Is it
      > possible to install Win32 on a linux machine ? how ?
      >
      > Jadi
      >
      > p.s. here is the code :
      >
      > use strict;
      > use Win32::OLE qw(in with);
      > use Win32::OLE::Const 'Microsoft Excel';
      > $Win32::OLE::Warn = 3;
      > # die on errors...
      > my $Excel =
      > Win32::OLE->GetActiveObject('Excel.Application')
      > || Win32::OLE->new('Excel.Application', 'Quit');
      > # get already active Excel
      >
      > # application or open new
      > my $Book =
      > $Excel->Workbooks->Open("C:\\DOCUMENTS\\test.xls");
      > # open Excel file
      > my $Sheet = $Book->Worksheets(1);
      > # select worksheet number 1
      > my $array = $Sheet->Range("A8:B9")->{'Value'};
      > # get the contents
      > $Book->Close;
      > foreach my $ref_array (@$array) {
      > # loop through the array
      >
      > # referenced by $array
      > foreach my $scalar (@$ref_array) {
      > print "$scalar\t";
      > }
      > print "\n";
      > }
      >
      >
      >
      >
      >
      >
      > [Non-text portions of this message have been
      > removed]
      >
      >

      __________________________________________________
      Do you Yahoo!?
      Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
      http://platinum.yahoo.com
    Your message has been successfully submitted and would be delivered to recipients shortly.