This project has moved and is read-only. For the latest updates, please go here.


Copying a worksheet (from template workbook) containing an image does not copy the image


I'm trying to workaround the current ClosedXML limitations in terms of image-support.
There's no way to add an image through code, and the suggested workaround is to use a file template containing the image.

This works fine if the workbook only contains a single worksheet, but as soon as you need to duplicate the worksheet, the image no longer appears on the copied worksheets.

Do you have any other suggestions for this scenario to work (I don't know the number of worksheets upfront as these are dynamically generated). Ideally, ClosedXML gets full image support, but a short-term solution for this scenario would help me out for now.
Closed Sep 23, 2013 at 2:50 PM by MDeLeon
There's no workaround for copying worksheets with images at the moment.



XavierDecoster wrote Sep 23, 2013 at 3:37 PM

For those who hit this issue, my current approach is the following:
  • have a template with the duplicated worksheets (let's say 20 sheets, choose your max based on the maximum sheets you'll generate)- reuse/rename the existing once during generation- remove the one's you don't need