Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Appending data into an Excel Sheet

by Brutha (Friar)
on Feb 28, 2008 at 13:06 UTC ( #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.

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.

      Hi Sudhakar, I have installed active perl 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://670900]
and one hand claps...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2018-03-19 05:29 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (232 votes). Check out past polls.