NativeExcel suite v3.x

TXLSShapes class

Unit: xlsdrw
A collection of all the TXLSShape objects on the specified sheet. Each TXLSShape object represents an object in the drawing layer, such as a comment or picture.

Using the TXLShapes Collection

Use the Shapes property to return the TXLSShapes collection.
Use Shapes[index], where index is the shape's index number, to return a single TXLSShape object.
The following example sets the width for shape one on worksheet one.
WorkBook.Sheets[1].Shapes[1].Width := 90;
The following example demonstrates how to access each shape on worksheet.
Var
  Shape: TXLSShape;
  cnt, i: integer;
begin
  With WorkBook.Sheets[1] do begin
    cnt := Shapes.Count;
    for i := 1 to cnt do begin
      Shape := Shapes[i];
      //do something with Shape
      //......
    end;
  end;
end;
The following example adds the shape with JPEG picture on worksheet one.
With WorkBook.Sheets[1] do begin
   Cells[3, 3].Select; //the upper-left corner of the shape
   Shapes.AddPicture('image.jpg');
end;
Use the Delete method to remove shape from a Sheets collection.
The following example deletes first shape from Shapes collection on sheet one.
WorkBook.Sheets[1].Shapes[1].Delete;

Properties

Methods

Copyright © NikaSoft 2004-2013