Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Appending data into an Excel Sheet

by Brutha (Friar)
on Feb 28, 2008 at 13:06 UTC ( [id://670900]=note: print w/replies, xml ) Need Help??


in reply to Appending data into an Excel Sheet

As your question is rather vague, I just can guess what your platform is. I am successfully updating an Excel-Shit under Windows, I went directly through OLE hell and used Win32::OLE, Win32::OLE::Const 'Microsoft Excel', and the like. You can record your changes as a macro and translate the calls to Perl. I use something like:
my $Excel = Win32::OLE->GetActiveObject('Excel.Application'); unless ($Excel) { $Excel = Win32::OLE->new('Excel.Application'); } my $xls = $Excel->Workbooks->Open(...); my $sheet = $xls->Worksheets(1);
Open the Excel Macro editor and open help, that gives you all the methods. You will go through hell with all those parameters, undebuggable objects and all those esoteric VBA paranormalia. One last hint, use something like this to find the last used row to append things:
my $lastrow = $sheet->UsedRange->Find( { What => "*", SearchDirection => xlPrevious, SearchOrder => xlByRows } )->{Row};

And it came to pass that in time the Great God Om spake unto Brutha, the Chosen One: "Psst!"
(Terry Pratchett, Small Gods)

Replies are listed 'Best First'.
Re^2: Appending data into an Excel Sheet
by psr473 (Novice) on Feb 28, 2008 at 13:39 UTC
    Thank you Brutha.

    Now I am doing on Windows OS, If I am able to do successfully on Windows OS then I will move on to LINUX.

    Sudhakara
Re^2: Appending data into an Excel Sheet
by psr473 (Novice) on Apr 15, 2008 at 08:10 UTC
    Hi Brutha,
    I was successful in opening existing excel file. But I need it on Linux. Can you suggest me a module, or if you have any code please tell me. The existing excel file contains graphs in some sheets.
    Thanks in Advance Brutha.

    Sudhakara.
      Hi Sudhakar, I have installed active perl 5.8.8.2.2 version in windows and I want to update the daily details in to spread sheet or excel sheet automatically using perl. which are the perl modules required to be installed to support the spread sheet for this existing perl version. Can you please provide the information on this... thanks & regards S S Maradi

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://670900]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-19 15:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found