We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Excel: How to check if a cell contains an image

Hi, I need to manage images in an excel document, and I seen this video:

This was very useful for me, and I can add images on a range:

Dim imgIndex As Integer = range.Worksheet.Pictures.Add(range.FirstRow, range.FirstColumn, imageFile)
Dim pic As Aspose.Cells.Drawing.Picture = range.Worksheet.Pictures(imgIndex)
pic.Placement = Drawing.PlacementType.FreeFloating

But now I need to check if an image is already in the range, and if it is I need to remove it.
Is there a way to check if an image is contained in a cell?

Thank you for your help

This message was posted using Page2Forum from Converting to PDF Files - Aspose.Cells for .NET


I think you may use some properties to determine the cell, e.g see the sample code segment here.

Dim pictures As Aspose.Cells.Drawing.PictureCollection = sheet.Pictures
Dim picture As Aspose.Cells.Drawing.Picture = pictures(0)
Dim UpperLeftRow As Integer = picture.UpperLeftRow
Dim UpperLeftColumn As Integer = picture.UpperLeftColumn
Dim LowerRightRow As Integer = picture.LowerRightRow
Dim LowerRightColumn As Integer = picture.LowerRightColumn