# Problem with using win32ole in Linux server

**URL:** <https://www.ruby-forum.com/t/problem-with-using-win32ole-in-linux-server/123251>\
**Category:** Ruby\
**Created:** [December 15, 2007, 12:38pm UTC](https://www.ruby-forum.com/t/problem-with-using-win32ole-in-linux-server/123251 "2007-12-15T12:38:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![veeraa2003](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/b487fb/32.png) [@veeraa2003](https://www.ruby-forum.com/u/veeraa2003)\
**Post date:** [December 15, 2007, 12:38pm UTC](https://www.ruby-forum.com/t/problem-with-using-win32ole-in-linux-server/123251/1 "2007-12-15T12:38:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![veeraa2003](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/b487fb/32.png) [@veeraa2003](https://www.ruby-forum.com/u/veeraa2003)\
**Post date:** [December 15, 2007, 12:54pm UTC](https://www.ruby-forum.com/t/problem-with-using-win32ole-in-linux-server/123251/2 "2007-12-15T12:54:21Z")

</div>

On Dec 15, 2007 12:38 PM, Veera S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 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.

---

<div class="post-metadata">

**Author:** ![veeraa2003](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/b487fb/32.png) [@veeraa2003](https://www.ruby-forum.com/u/veeraa2003)\
**Post date:** [December 15, 2007, 6:22pm UTC](https://www.ruby-forum.com/t/problem-with-using-win32ole-in-linux-server/123251/3 "2007-12-15T18:22:56Z")

</div>

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

Ron
