//Extract ranges for the string and add image to the range
Bitmap bm = new Bitmap(GetFullTemplatePath(value + ".jpg"));
if(IsStringExist(worksheet,value))
{
IRange[] ranges = worksheet.FindAll(value, ExcelFindType.Values);
if(ranges != null)
{
foreach (IRange range in ranges)
{
range.Clear();
worksheet.Pictures.AddPicture(range.Row, range.Column, GetFullTemplatePath(value + ".jpg"));
range.RowHeight = bm.Height;
}
}
}
|