Skip to content

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

Description

@MyklClason

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions