I am using a modified version of this code to create an excel document, add cells, and style cells. I am trying to modify this code to also be able to add images to a sheet. I am getting nowhere and there really is nothing on the web that will help. I am trying to read through the OpenXML productivity tool diff. which is kind of unhelpful. Can anyone here point me in the right direction?
Thanks.
Here is a link to a MSDN example with code you can download.
There is also Eric White's example and You Tube video
I wrote something on this here in a blog post: http://polymathprogrammer.com/2009/12/21/advanced-styling-in-excel-open-xml/
Note that it was originally written for the Open XML SDK 2.0 CTP version, so beware of the change from NumberFormat class to NumberingFormat class (when the SDK 2.0 was finalised)
If you want to isolate the code to just the image insertion, take a look here: http://polymathprogrammer.com/2009/11/30/how-to-insert-an-image-in-excel-open-xml/
I looked at the answers from Vincent Tan and David Yates. Since it took me hours of coding to have the following simple requirements met, I'll post my solution here so the next person can save some time.
Requirements:
Usage
Code: