# Spreadsheet creation

**URL:** <https://www.ruby-forum.com/t/spreadsheet-creation/190722>\
**Category:** Rails\
**Created:** [June 25, 2010, 7:53pm UTC](https://www.ruby-forum.com/t/spreadsheet-creation/190722 "2010-06-25T19:53:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![spex2004](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e9c0ed/32.png) [@spex2004](https://www.ruby-forum.com/u/spex2004)\
**Post date:** [June 25, 2010, 7:53pm UTC](https://www.ruby-forum.com/t/spreadsheet-creation/190722/1 "2010-06-25T19:53:54Z")

</div>

Hey guys,

I’m trying to create a spreadsheet with Ruby using the spreadsheet gem.  
I’m able to create a new sheet and add data and everything but I’m  
wondering, is there any way to preserve macros and vb projects in an  
existing xls file then add data to it in a new sheet? Currently, I’m  
opening a spreadsheet with macros and vb projects, adding a new sheet to  
it with my created data…but when I open it, the VB projects, macros  
and conditional formatting is all lost.

Any help would be greatly appreciated!

Thanks!

---

<div class="post-metadata">

**Author:** ![spex2004](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e9c0ed/32.png) [@spex2004](https://www.ruby-forum.com/u/spex2004)\
**Post date:** [June 29, 2010, 5:36pm UTC](https://www.ruby-forum.com/t/spreadsheet-creation/190722/2 "2010-06-29T17:36:26Z")

</div>

Spec Ex wrote:

> Hey guys,
> 
> I’m trying to create a spreadsheet with Ruby using the spreadsheet gem.  
> I’m able to create a new sheet and add data and everything but I’m  
> wondering, is there any way to preserve macros and vb projects in an  
> existing xls file then add data to it in a new sheet? Currently, I’m  
> opening a spreadsheet with macros and vb projects, adding a new sheet to  
> it with my created data…but when I open it, the VB projects, macros  
> and conditional formatting is all lost.
> 
> Any help would be greatly appreciated!
> 
> Thanks!

Anyone?
