Click or drag to resize

IWorksheet HasOleObjects Property

Gets or sets a value indicating whether this instance is OLE object.
Examples
The following code illustrates how to access the IListObjects collection in the worksheet to add a new IOleObject and check Ole Object:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Create image stream</para><para>System.Drawing.Image image = System.Drawing.Image.FromFile("image.png");</para><para>//Add ole object</para><para>IOleObject oleObject = worksheet.OleObjects.Add("Shapes.xlsx", image, OleLinkType.Embed);</para><para>//Check HasOleObject.Output will be true.</para>
 Console.Write(worksheet.HasOleObjects);

 <para>//Save to file</para><para>workbook.SaveToFile("HasOleObjects.xlsx");</para>

Namespace: Spire.Xls.Core
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
bool HasOleObjects { get; }

Property Value

Type: Boolean
true if this instance is OLE object; otherwise, false .
See Also