[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Problem with using win32ole in Linux server.

Veera Sundaravel

12/15/2007 11:39:00 AM

Hi Every body,

I'm Having one excel file. I want this file using ruby, for this I used
win32ole. Here the code is.

require 'win32ole'
excel = WIN32OLE.new('excel.application')
excel.visible = false
excel.workbooks.open('D:\projects\excel\app\controllers\data.xls') #
absolute file path
excel.range('c25').value = 45
puts excel.range('c25').value
puts excel.range('e10').value


But the problem is, in linux server I cant use win32ole. Can anybody
suggest what will be the alternate to win32ole in linux server.

Thanks in Advance,
T.Veeraa.
--
Posted via http://www.ruby-....

2 Answers

Jano Svitok

12/15/2007 11:54:00 AM

0

On Dec 15, 2007 12:38 PM, Veera Sundaravel <veeraa2003@yahoo.co.in> wrote:
> Hi Every body,
>
> I'm Having one excel file. I want this file using ruby, for this I used
> win32ole. Here the code is.
>
> require 'win32ole'
> excel = WIN32OLE.new('excel.application')
> excel.visible = false
> excel.workbooks.open('D:\projects\excel\app\controllers\data.xls') #
> absolute file path
> excel.range('c25').value = 45
> puts excel.range('c25').value
> puts excel.range('e10').value
>
>
> But the problem is, in linux server I cant use win32ole. Can anybody
> suggest what will be the alternate to win32ole in linux server.

This was discussed already, although quite some time ago.
Basically the idea is either 1. run excel under wine (or on a windows
box) and communicate with linux using drb, or 2. using openoffice to
open the excel file.
There's a ruby lib to read excel files too (parseexcel). I don't know
if there's one for writing.

Steckly, Ron

12/15/2007 5:21:00 PM

0

Yes, but if you use OpenOffice, how do you script it? Does Ruby have a
library that works with OO?

Ron

-----Original Message-----
From: Jano Svitok [mailto:jan.svitok@gmail.com]=20
Sent: Saturday, December 15, 2007 6:54 AM
To: ruby-talk ML
Subject: Re: Problem with using win32ole in Linux server.

On Dec 15, 2007 12:38 PM, Veera Sundaravel <veeraa2003@yahoo.co.in>
wrote:
> Hi Every body,
>
> I'm Having one excel file. I want this file using ruby, for this I
used
> win32ole. Here the code is.
>
> require 'win32ole'
> excel =3D WIN32OLE.new('excel.application')
> excel.visible =3D false
> excel.workbooks.open('D:\projects\excel\app\controllers\data.xls') #
> absolute file path
> excel.range('c25').value =3D 45
> puts excel.range('c25').value
> puts excel.range('e10').value
>
>
> But the problem is, in linux server I cant use win32ole. Can anybody
> suggest what will be the alternate to win32ole in linux server.

This was discussed already, although quite some time ago.
Basically the idea is either 1. run excel under wine (or on a windows
box) and communicate with linux using drb, or 2. using openoffice to
open the excel file.
There's a ruby lib to read excel files too (parseexcel). I don't know
if there's one for writing.