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

Copy an image from one sheet to another sheet? #426

Open
MyklClason opened this issue Aug 16, 2022 · 0 comments
Open

Copy an image from one sheet to another sheet? #426

MyklClason opened this issue Aug 16, 2022 · 0 comments

Comments

@MyklClason
Copy link

So here is what I'm trying to do:

  1. Given an excel file with a single sheet it in (the template sheet)
  2. Duplicate that sheet one or more times and changes each sheet (IE: Add rows)
  3. The template sheet has an image in it.

This is working generally fine thanks to:
https://stackoverflow.com/questions/29507841/create-multiple-sheets-that-uses-same-template-using-rubyxl

However, I'm having trouble figuring out how to copy the image. I tried the following based roughly on how cells was handled but didn't work out, and after a fair bit of digging around rows and cells I'm a bit stuck as to what to try next. It looks like the row data might have something in but it's a bit to buried for me to debug (ran into an infinite loop of too much nesting trying to inspect it).

worksheet.generic_storage = template.generic_storage.map(&:dup)

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

1 participant