# Create a new excel file

**URL:** <https://www.ruby-forum.com/t/create-a-new-excel-file/170572>\
**Category:** Ruby\
**Created:** [June 19, 2009, 7:02am UTC](https://www.ruby-forum.com/t/create-a-new-excel-file/170572 "2009-06-19T07:02:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vetrivel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/dc4da7/32.png) [@vetrivel](https://www.ruby-forum.com/u/vetrivel)\
**Post date:** [June 19, 2009, 7:02am UTC](https://www.ruby-forum.com/t/create-a-new-excel-file/170572/1 "2009-06-19T07:02:45Z")

</div>

How to create a new excel file in ruby with examples .

---

<div class="post-metadata">

**Author:** ![vetrivel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/dc4da7/32.png) [@vetrivel](https://www.ruby-forum.com/u/vetrivel)\
**Post date:** [June 19, 2009, 8:23am UTC](https://www.ruby-forum.com/t/create-a-new-excel-file/170572/2 "2009-06-19T08:23:10Z")

</div>

With your bare hands and a computer usually.

Jayanth

On Fri, Jun 19, 2009 at 10:32 AM, Vetrivel V. \<

---

<div class="post-metadata">

**Author:** ![vetrivel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/dc4da7/32.png) [@vetrivel](https://www.ruby-forum.com/u/vetrivel)\
**Post date:** [June 19, 2009, 7:35pm UTC](https://www.ruby-forum.com/t/create-a-new-excel-file/170572/3 "2009-06-19T19:35:58Z")

</div>

Vetrivel V. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> How to create a new excel file in ruby with examples .

Depends what system you’re running. There’s one way on Windows and a  
different way on Mac OS X. m.

---

<div class="post-metadata">

**Author:** ![vetrivel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/dc4da7/32.png) [@vetrivel](https://www.ruby-forum.com/u/vetrivel)\
**Post date:** [June 19, 2009, 8:00pm UTC](https://www.ruby-forum.com/t/create-a-new-excel-file/170572/4 "2009-06-19T20:00:41Z")

</div>

Funny you mention this. I myself was trying to remember what I need to  
export to Excel and I was about to do the whole thing in CSV (might  
still do anyway, since Excel has support for it) when this came  
through. Thanks!

On Fri, Jun 19, 2009 at 1:50 PM, Daniel B.[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > > How to create a new excel file in ruby with examples .  
> > > Dan

–  
Rilindo F.  
AOL Instant Messenger: rilindo  
Google Talk: removed\_email\_address@domain.invalid  
Web S.: [http://www.monzell.com](http://www.monzell.com)  
Primary: removed\_email\_address@domain.invalid  
Secondary: removed\_email\_address@domain.invalid  
"Rich bachelors should be heavily taxed. It is not fair that some men  
should be happier than others. – Oscar Wilde

---

<div class="post-metadata">

**Author:** ![vetrivel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/dc4da7/32.png) [@vetrivel](https://www.ruby-forum.com/u/vetrivel)\
**Post date:** [June 19, 2009, 7:51pm UTC](https://www.ruby-forum.com/t/create-a-new-excel-file/170572/5 "2009-06-19T19:51:51Z")

</div>

> Depends what system you’re running. There’s one way on Windows and a  
> different way on Mac OS X. m.

No, actually, the spreadsheet gem is cross-platform.

gem install spreadsheet.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![vetrivel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/dc4da7/32.png) [@vetrivel](https://www.ruby-forum.com/u/vetrivel)\
**Post date:** [June 19, 2009, 10:46pm UTC](https://www.ruby-forum.com/t/create-a-new-excel-file/170572/6 "2009-06-19T22:46:32Z")

</div>

Daniel B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Depends what system you’re running. There’s one way on Windows and a  
> > different way on Mac OS X. m.
> 
> No, actually, the spreadsheet gem is cross-platform.

Ooops, sorry about that. Okay, I guess what I meant is that there’s also  
at least one way on Mac OS X that doesn’t exist on Windows. On Mac OS X  
you could do it with rb-appscript; that’s what my book manuscript is  
about here:

[http://www.apeth.com/ruby/10examples.html](http://www.apeth.com/ruby/10examples.html)

The “Microsoft Excel” section on that page includes an example where we  
create a new Excel document, populate it with some data, and tell Excel  
to draw a chart. m.
