--Apple-MailBF9B92A-5B7C-483F-9F65-AB05C839ACC0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset -ascii On Nov 23, 2011, at 1:33 AM, Mamba Black wrote: > > 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 > > Attachments: > http://www.ruby-forum.com/attachment/6783/excel.png At first glance without seeing what you're actually writing, I would say this is because you're not actually writing out the binary .xls format Excel is expecting. Your best option is to write out the XML version of Excel files (.xlsx). You can get the complete specification for the XML you need here: http://msdn.microsoft.com/en-us/library/dd922181(v=office.12).aspx Wayne-Apple-MailBF9B92A-5B7C-483F-9F65-AB05C839ACC0--