C# & OpenXML: Insert an image into an excel document

后端 未结 3 555
独厮守ぢ
独厮守ぢ 2020-12-16 23:01

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

3条回答
  •  爱一瞬间的悲伤
    2020-12-16 23:57

    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/

提交回复
热议问题