Modifying an Excel file with Ruby

Hi all,
I have an Excel XLS file that is full of pre-existing charts, formulas,
worksheets, etc.
I need to be able to open it up, fill in a hidden worksheet with some
values from a database, and save it out again without losing all the
charts/formulas/worksheets/etc. So
http://rubyforge.org/projects/spreadsheet/ is out of the question.
And i can't use win32::ole because i won't be hosting on a windows
server.

Does anyone have any ideas? I'm even considering shelling out to a perl
or python script, but i thought i'd look here first.

Thanks in advance,
Chris

···

--
Posted via http://www.ruby-forum.com/.

Dear Chris,

just a little googling came up with this:

http://rails.co.za/articles/2006/12/16/excel-ole-automation-with-ruby-in-linux

HTH,

Axel

···

--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

Hi,

I never tried this binding on POI Java library, but it could be useful
to you :

http://poi.apache.org/poi-ruby.html

Come

···

On 17 juin, 13:01, Chris Hulbert <chris.hulb...@gmail.com> wrote:

Hi all,
I have an Excel XLS file that is full of pre-existing charts, formulas,
worksheets, etc.
I need to be able to open it up, fill in a hidden worksheet with some
values from a database, and save it out again without losing all the
charts/formulas/worksheets/etc. Sohttp://rubyforge.org/projects/spreadsheet/is out of the question.
And i can't use win32::ole because i won't be hosting on a windows
server.

Does anyone have any ideas? I'm even considering shelling out to a perl
or python script, but i thought i'd look here first.

Thanks in advance,
Chris

--
Posted viahttp://www.ruby-forum.com/.

just a little googling came up with this:
http://rails.co.za/articles/2006/12/16/excel-ole-automation-with-ruby-in-linux
HTH,
Axel

Hi,
Thanks, but i can't use OLE because this won't be hosted on windows.

I never tried this binding on POI Java library, but it could be useful
to you :
POI Ruby Bindings
Come

Fair enough, i assumed i'd have to use a java or perl or python library.
Its a pity, because an all-ruby solution keeps the cost of hosting down
:slight_smile:

Any all-ruby solutions? I guess i *could* go to the effort of porting
the python pyExcelarator library to ruby, it's the closest to what i'm
after, but if there's an solution already out there, i'd like to hear
about it.

Cheers

···

--
Posted via http://www.ruby-forum.com/\.

Dear Chris,

Hi,
Thanks, but i can't use OLE because this won't be hosted on windows.

the claim in the link I sent you was that they
do use Linux, rather than Windows, and still
got (some workaround access to) OLE to work ..
But I haven't tried this myself, so I wrote
"just a little googling" .... but I'd be interested
if you could post what solution you eventually go for.

Best regards,

Axel

-------- Original-Nachricht --------

···

Datum: Wed, 20 Jun 2007 20:40:25 +0900
Von: Chris Hulbert <chris.hulbert@gmail.com>
An: ruby-talk@ruby-lang.org
Betreff: Re: Modifying an Excel file with Ruby

> just a little googling came up with this:
>
http://rails.co.za/articles/2006/12/16/excel-ole-automation-with-ruby-in-linux
> HTH,
> Axel

Hi,
Thanks, but i can't use OLE because this won't be hosted on windows.

> I never tried this binding on POI Java library, but it could be useful
> to you :
> POI Ruby Bindings
> Come

Fair enough, i assumed i'd have to use a java or perl or python library.
Its a pity, because an all-ruby solution keeps the cost of hosting down
:slight_smile:

Any all-ruby solutions? I guess i *could* go to the effort of porting
the python pyExcelarator library to ruby, it's the closest to what i'm
after, but if there's an solution already out there, i'd like to hear
about it.

Cheers

--
Posted via http://www.ruby-forum.com/\.

--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: GMX Handytarife 2024 | jetzt wechseln & sparen

Axel Etzold wrote:

the claim in the link I sent you was that they
do use Linux, rather than Windows, and still
got (some workaround access to) OLE to work ..
But I haven't tried this myself, so I wrote
"just a little googling" .... but I'd be interested
if you could post what solution you eventually go for.

Best regards,

Axel

Cheers buddy, I must have switched off the moment i saw 'ole' in the
URL.
I had a read, and it appears he got it to work using WINE. Clever trick,
and i guess you could do that if you owned the server yourself (or you
had a *really* good virtual hosting package) but for my situation (using
a typical rails host) it probably isn't going to help.
Still, thanks for the pointer.

···

--
Posted via http://www.ruby-forum.com/\.

Chris Hulbert wrote:

Axel Etzold wrote:

the claim in the link I sent you was that they
do use Linux, rather than Windows, and still
got (some workaround access to) OLE to work ..
But I haven't tried this myself, so I wrote
"just a little googling" .... but I'd be interested
if you could post what solution you eventually go for.

Hi Chris,
I am facing same issue for my application, could you share with us if
you find some better solution.

···

--
Posted via http://www.ruby-forum.com/\.

I too am interested in this question. I'll definitely post what I find
out and hope to hear from others.

···

--
Posted via http://www.ruby-forum.com/.

Christopher Small wrote:

I too am interested in this question. I'll definitely post what I find
out and hope to hear from others.

This is your best bet:
http://poi.apache.org/poi-ruby.html

I've tried the .net version of POI, it's great - far better than any
other open source excel libraries. I can only assume the java and ruby
versions are good too.

···

--
Posted via http://www.ruby-forum.com/\.