Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error occurs when clone a sheet that contains the image #236

Open
328 opened this issue Jun 29, 2016 · 2 comments
Open

Error occurs when clone a sheet that contains the image #236

328 opened this issue Jun 29, 2016 · 2 comments

Comments

@328
Copy link

328 commented Jun 29, 2016

Hi,
I have cloned the sheet in this program. ↓
but, If the clone the sheet that contains the image,
It is an error to open the xlsx.
(When you open the xlsx, dialog of the recovery message is displayed)

require 'rubyXL'

workbook = RubyXL::Parser.parse('template.xlsx')
org_sheet =  workbook['Sheet1']


for num in 3..10 do
  add_sheet = Marshal.load(Marshal.dump(org_sheet))
  add_sheet.sheet_id = num
  add_sheet.sheet_name = 'SheetName'+num.to_s
  add_sheet.workbook = workbook

  add_sheet.add_cell(0, 0, num)
  workbook.worksheets << add_sheet
end

workbook.write("outputs.xlsx")

I want to avoid errors.

@328
Copy link
Author

328 commented Jun 29, 2016

Reproduction code

https://github.com/328--/rubyxl-sample

@calamo
Copy link

calamo commented Dec 2, 2016

Hi, were you able to clone the sheet?
I'm trying to clone a basic worksheet, without images, using your code and always get the following error:

no _dump_data is defined for class Nokogiri::XML::Namespace

Is there something that I'm missing to make the code work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants