# Parseexcel

**URL:** <https://www.ruby-forum.com/t/parseexcel/79732>\
**Category:** Ruby\
**Created:** [December 18, 2006, 4:20pm UTC](https://www.ruby-forum.com/t/parseexcel/79732 "2006-12-18T16:20:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex-osu3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Post date:** [December 18, 2006, 4:20pm UTC](https://www.ruby-forum.com/t/parseexcel/79732/1 "2006-12-18T16:20:32Z")

</div>

Hi all,

I can use parseexcel to open excel file and process the data within  
excel. 1)But I am not sure how to write the processed data back to excel  
using parseexcel. What is the syntax for this? 2) How to select a range  
of cells, for example, row1,column 1 to row 3,column 10 instead of  
whole columns or whole rows.

Thank you in advance,

Li

---

<div class="post-metadata">

**Author:** ![alex-osu3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Post date:** [December 18, 2006, 6:17pm UTC](https://www.ruby-forum.com/t/parseexcel/79732/2 "2006-12-18T18:17:48Z")

</div>

Hi Li

On 12/18/06, Li Chen [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 1)But I am not sure how to write the processed data back to excel  
> using parseexcel. What is the syntax for this?  
> ParseExcel does not write Excel files. For that you will have to use  
> the SpreadSheet::Excel library developed by Daniel B… I plan to  
> merge the two libraries in the future, but that will have to wait  
> until late 2007.

Both libraries are available here, or via gem install:  
[http://rubyforge.org/frs/?group\_id=678](http://rubyforge.org/frs/?group_id=678)

> 1. How to select a range  
> of cells, for example, row1,column 1 to row 3,column 10 instead of  
> whole columns or whole rows.  
> There are no methods that do directly what you want - you’ll have to  
> do something like:  
> 1.upto(3) do |row|  
> 1.upto(10) do |col|  
> puts worksheet.cell(row, col)  
> end  
> end

hth

Hannes

---

<div class="post-metadata">

**Author:** ![alex-osu3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Post date:** [December 18, 2006, 8:02pm UTC](https://www.ruby-forum.com/t/parseexcel/79732/3 "2006-12-18T20:02:55Z")

</div>

Hannes W. wrote:

> > 1. How to select a range  
> > of cells, for example, row1,column 1 to row 3,column 10 instead of  
> > whole columns or whole rows.  
> > There are no methods that do directly what you want - you’ll have to  
> > do something like:  
> > 1.upto(3) do |row|  
> > 1.upto(10) do |col|  
> > puts worksheet.cell(row, col)  
> > end  
> > end

Thanks. I’ll give them a try tonight to see if they work.

Li

---

<div class="post-metadata">

**Author:** ![alex-osu3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Post date:** [December 19, 2006, 2:10am UTC](https://www.ruby-forum.com/t/parseexcel/79732/4 "2006-12-19T02:10:11Z")

</div>

> Hannes W. wrote:
> 
> > > 1. How to select a range  
> > > of cells, for example, row1,column 1 to row 3,column 10 instead of  
> > > whole columns or whole rows.  
> > > There are no methods that do directly what you want - you’ll have to  
> > > do something like:  
> > > 1.upto(3) do |row|  
> > > 1.upto(10) do |col|  
> > > puts worksheet.cell(row, col)  
> > > end  
> > > end

Hi Hannes,

Do you know what the advantages of using parseexcel are , compared to  
export data from excel into text file, parse them,then import them back  
into excel using spreadsheetexcel?

Thanks,

Li

---

<div class="post-metadata">

**Author:** ![alex-osu3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Post date:** [December 20, 2006, 8:27pm UTC](https://www.ruby-forum.com/t/parseexcel/79732/5 "2006-12-20T20:27:34Z")

</div>

Li

On 12/19/06, Li Chen [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Do you know what the advantages of using parseexcel are , compared to  
> export data from excel into text file, parse them,then import them back  
> into excel using spreadsheetexcel?

I probably would not call them advantages, but circumstances:

- if you cannot choose your input format, and thus would have to  
perform that export to text (csv?) manually, use parseexcel.
- parseexcel can give you information on the data contained in a cell  
(Cell#type returns :date, :numeric or :text) - if you need that  
information, use parseexcel.

hth

Hannes

---

<div class="post-metadata">

**Author:** ![alex-osu3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Post date:** [April 16, 2007, 7:13am UTC](https://www.ruby-forum.com/t/parseexcel/79732/6 "2007-04-16T07:13:55Z")

</div>

Hannes W. wrote:

> Li
> 
> On 12/19/06, Li Chen [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Do you know what the advantages of using parseexcel are , compared to  
> > export data from excel into text file, parse them,then import them back  
> > into excel using spreadsheetexcel?
> 
> I probably would not call them advantages, but circumstances:
> 
> - if you cannot choose your input format, and thus would have to  
> perform that export to text (csv?) manually, use parseexcel.
> - parseexcel can give you information on the data contained in a cell  
> (Cell#type returns :date, :numeric or :text) - if you need that  
> information, use parseexcel.
> 
> hth
> 
> Hannes

Can anyone Help me, how do I use excel file for data driven  
testing in Selenium Remote Control. Basically My problem is, we have  
100 records,how can i fetch Username & password field to execute my  
application with every User

---

<div class="post-metadata">

**Author:** ![alex-osu3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Post date:** [April 16, 2007, 3:20pm UTC](https://www.ruby-forum.com/t/parseexcel/79732/7 "2007-04-16T15:20:44Z")

</div>

On Apr 16, 1:13 am, Andy PS [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Can anyone Help me, how do I use excel file for data driven  
> testing in Selenium Remote Control. Basically My problem is, we have  
> 100 records,how can i fetch Username & password field to execute my  
> application with every User
> 
> –  
> Posted viahttp://www.ruby-forum.com/.

Andy-

I know nothing about Selenium. If, however, you are on a Windows  
machine with Excel installed, you could use win32ole to automate  
Excel. If you think that has potential, you’ll find more info here:

> **[Ruby on Windows](http://rubyonwindows.blogspot.com/search/label/excel)**
>
> On using the Ruby programming language on the Microsoft Windows platform

David

> **[Ruby on Windows](http://rubyonwindows.blogspot.com)**
>
> On using the Ruby programming language on the Microsoft Windows platform
