Spreadsheet gem errors

D

Dominic Sisneros

[Note: parts of this message were removed to make it a legal post.]

I am using the spreadsheet gem to try to create workbook by copying the
first worksheet

work_book = Spreadsheet.open './test.xls'
sheet = work_book.worksheet 0

sheet2 work_book.add_worksheet(sheet)
sheet.name = "copy"

workbook.write('./test.new.xls')

I get a corrupt file with the following with the following log:

Microsoft Office Excel File Repair Log

Errors were detected in file
'C:\programming\ruby\circuits\lib\circuits\ZLC_BZN.Site.Specific.Requirements.2010-10-21.xls'
The following is a list of repairs:

Damage to the file was so extensive that repairs were not possible. Excel
attempted to recover your formulas and values, but some data may have been
lost or corrupted.

does the add_worksheet function work and am I using it right?

Thanks,

dominic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,187
Members
46,730
Latest member
AudryNolan

Latest Threads

Top