If you are running on Windows when creating your Excel file, the
following code will do what you're looking for.

require 'win32ole'

excel = WIN32OLE.connect('Excel.Application') rescue excel =
WIN32OLE.new('Excel.Application')

book = excel.workbooks.add
sheet = book.worksheets(1)

sheet.Cells(1, 1).value = "text to go into merged cells"
sheet.Range("A1:C1").Merge
excel.visible = true

Unfortunately, I don't have any experience with the spreadsheet gem.
When generating excel spreadsheets, I use the win32ole gem.

Hope this helps...
Bob

On Oct 25, 8:34 am, Joe Peck <[email protected]> wrote:
> > I think you may have sent this to the wrong list, this is for Ruby on
> > Rails issues.
>
> > (If I remember correctly you mark the cells and right click and there
> > is an option for spanning there).
>
> > Colin
>
> Sorry, I meant to add that I'm doing this programmatically with the
> Spreadsheet gem.  I'm trying to get it to generate a spreadsheet with
> some cells spanning multiple columns.
>
> Thanks for the reply, though, and sorry for not being clear :)
>
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to