This project has moved. For the latest updates, please go here.

Add Picture in Comments of cell

Feb 2, 2013 at 4:43 AM
Are there plans to allow inserting images into cell comments? I have searched everywhere and have not found a way to do this with EPPlus. Spreadsheet Light (http://www.spreadsheetlight.com) has this feature and it uses the same Open XML sdk but it lacks support for LINQ and only allows bulk loading from datatables. Is there any kind of workaround at the moment besides using VBA? Thanks.
Feb 2, 2013 at 6:37 AM
Edited Feb 2, 2013 at 9:03 AM
Sometimes people mix epplus code with lower level OpenXML code. So I suppose you could do stuff with epplus to prepare your spreadsheet. Save it and close it with epplus then perhaps open the same spreadsheet with spreadsheetlight and then add the comment with the image.

I tried to use the excel_worksheet_2.Cells["A15"].Comment.RichText.Add() with the most minimal rich text format string including '\' escape character handling. But it would not work at run time. I assume If I could read a RTF file that has an image I could somehow in inject that as an epplus RTF string comment. But I could not get that to work either.

/EDIT: From spreadsheetlight.com:

Compiling the source code? Create your own (Visual Studio?) solution/project and add these references:
DocumentFormat.OpenXml (from the Open XML SDK)
System
System.Data
System.Drawing
System.Windows.Forms
System.XML
System.Xml.Linq
WindowsBase
.. The source code is not packaged into a Visual Studio .sln solution file which is a bit weird but as it says above you can use the source code into a new empty Visual Studio project and then add the using.. references so you can use all of .NET features including LINQ.

I am new to coding and initially started using DataTables as they are flexible but since I have found that List<>'s with class wrappers are far faster for loading from a database and querying.