Spreadsheet gem errors


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"


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

Microsoft Office Excel File Repair Log

Errors were detected in file
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?




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