# Using Ruby to drive Excel calculations

**URL:** <https://www.ruby-forum.com/t/using-ruby-to-drive-excel-calculations/70576>\
**Category:** Ruby\
**Created:** [September 30, 2006, 10:36am UTC](https://www.ruby-forum.com/t/using-ruby-to-drive-excel-calculations/70576 "2006-09-30T10:36:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [September 30, 2006, 10:36am UTC](https://www.ruby-forum.com/t/using-ruby-to-drive-excel-calculations/70576/1 "2006-09-30T10:36:43Z")

</div>

I have a Rails application that mimics some arithmetic calculations done  
in an Excel spreadsheet. The Excel spreadsheet generates outputs in two  
cells based on changes in one cell. There are on the order of at least  
200 combinations of input data.

In order to verify that the Ruby calculations match the Excel  
spreadsheet calculations, I’d like to automate the calculations in both  
the Ruby program and the Excel spreadsheet and verify them against each  
other.

I’m aware of parseexcel, but what I really need is to be able to  
interact with an Excel spreadsheet to modify input and read output in  
real time. I believe that there is a module that will let me run an  
instance of Excel in Ruby (using OLE stuff I think).

Am I right about this module and, if so, can it be used to do what I  
describe (drive the Excel spreadsheet from Ruby)?

Thanks,  
Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [September 30, 2006, 11:12am UTC](https://www.ruby-forum.com/t/using-ruby-to-drive-excel-calculations/70576/2 "2006-09-30T11:12:00Z")

</div>

Wes G. wrote:

/ …

> Am I right about this module and, if so, can it be used to do what I  
> describe (drive the Excel spreadsheet from Ruby)?

There’s been plenty of discussion on this topic.

[http://groups.google.com/groups/search?q=ruby+excel](http://groups.google.com/groups/search?q=ruby+excel)
