From: Randy Morgan Date: 2011-12-03T10:28:00+09:00 Subject: Re: Create Excel Sheet(.xls/.xlsx) Mamba Black wrote in post #1033268: > Hi, > I need to create a excel sheet(.xls or .xlsx). > My Code: > > if File.exists?("test.xls") > puts "File EXISTS" > -----my code---- > else > File.open(fileToTest, File::WRONLY|File::CREAT|File::EXCL) > puts "-------FILE CREATED--------" > ----my code---- > end > > It creates an excel file(test.xls), but when I try to open the file I > get an alert box as shown in the attachment. > > I working on Windows 7, MS Office 2007 > > Thanks You should look at axlsx and act_as_xlsx It supports ruby 1.8.7 - 1.9.3, is fully documented and supports much more that spreadsheet does. http://rubygems.org/gems/axlsx or if you are building a rails app: http://rubygems.org/gems/acts_as_xlsx The examples in the README will show you how to do it. It requires rmagick to automatically format column widths so be sure to read this: rmagick.rubyforge.org/install-faq.html -- Posted via http://www.ruby-forum.com/.