# Reading values from an excel spreadsheet

**URL:** <https://www.ruby-forum.com/t/reading-values-from-an-excel-spreadsheet/116910>\
**Category:** Ruby\
**Created:** [October 11, 2007, 1:50am UTC](https://www.ruby-forum.com/t/reading-values-from-an-excel-spreadsheet/116910 "2007-10-11T01:50:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![krishnakishore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/bb73d2/32.png) [@krishnakishore](https://www.ruby-forum.com/u/krishnakishore)\
**Post date:** [October 11, 2007, 1:50am UTC](https://www.ruby-forum.com/t/reading-values-from-an-excel-spreadsheet/116910/1 "2007-10-11T01:50:09Z")

</div>

does anybody know how to open a spreadsheet and read the values in the  
cells and store them into an array using ruby?

---

<div class="post-metadata">

**Author:** ![krishnakishore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/bb73d2/32.png) [@krishnakishore](https://www.ruby-forum.com/u/krishnakishore)\
**Post date:** [October 11, 2007, 1:57am UTC](https://www.ruby-forum.com/t/reading-values-from-an-excel-spreadsheet/116910/2 "2007-10-11T01:57:55Z")

</div>

Krishna V. wrote:

> does anybody know how to open a csv and read the values in the  
> cells and store them into an array using ruby?

---

<div class="post-metadata">

**Author:** ![krishnakishore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/bb73d2/32.png) [@krishnakishore](https://www.ruby-forum.com/u/krishnakishore)\
**Post date:** [October 11, 2007, 1:58am UTC](https://www.ruby-forum.com/t/reading-values-from-an-excel-spreadsheet/116910/3 "2007-10-11T01:58:23Z")

</div>

Krishna V. wrote:

> Krishna V. wrote:
> 
> > does anybody know how to open a csv and read the values in the  
> > cells and store them into an array using ruby?

I actually need it for csv files not xls files…

---

<div class="post-metadata">

**Author:** ![krishnakishore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/bb73d2/32.png) [@krishnakishore](https://www.ruby-forum.com/u/krishnakishore)\
**Post date:** [October 11, 2007, 2:07am UTC](https://www.ruby-forum.com/t/reading-values-from-an-excel-spreadsheet/116910/4 "2007-10-11T02:07:47Z")

</div>

Have a looky here:

[http://fastercsv.rubyforge.org/](http://fastercsv.rubyforge.org/)

---

<div class="post-metadata">

**Author:** ![krishnakishore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/bb73d2/32.png) [@krishnakishore](https://www.ruby-forum.com/u/krishnakishore)\
**Post date:** [October 11, 2007, 5:32am UTC](https://www.ruby-forum.com/t/reading-values-from-an-excel-spreadsheet/116910/5 "2007-10-11T05:32:07Z")

</div>

Krishna V. wrote:

> does anybody know how to open a spreadsheet and read the values in the  
> cells and store them into an array using ruby?

xl=WIN32OLE.new(‘Excel.Application’)  
book = xl.Workbooks.Open(‘test.xls’)  
v=xl.Cells(1,1).value  
xl.Cells(1,2).value=v  
…
