1
votes

With the use of the Open XML SDK 2.0, I did preformed the Reflected Code of an Excel file. Along with other things, the Excel file has some images in some of the cells. When I run the code that was generated, the file show the images just fine.

What I need to do is to programatically inject images in place of the images that are there now. The thing is, I cannot find where the images are at in the code that was generated. How can I figure this out? Also what is the easiest way to replace those images with new ones programmatically?

1

1 Answers

0
votes

You may want to take a look at a similar question about inserting images into Excel files with OpenXML SDK: C# & OpenXML: Insert an image into an excel document.

Basically, those files are created as separate document parts. The answer I linked to should show You how to insert a new image into a document, however, in order to substitute existing images with your custom ones, you could probably just modify the binary data of appropriate ImagePart (and some other associated properties).

If You need some help with the code performing this task, let me know.