The Pictures Object (SAPictures)
* The Pictures object is not available in ExcelWriterSE, ExcelWriterLE,
or ExcelWriterFree.
The Pictures object is a collection, representing the set of all pictures in a single worksheet. To create a Pictures
object, use,
Set Pictures = ws.Pictures
Pictures Methods and Properties
*This feature is not available in
ExcelWriterSE, ExcelWriterLE, or ExcelWriterFree.
| Pictures Methods and Properties |
| Count* |
Counts the number of pictures in a worksheet. To retrieve the number of pictures included in
a worksheet, use,
PictureCount = ws.pictures.count
Top |
| CreateFromFile* |
Creates a Picture
object from an existing image file.
CreateFromFile takes five parameters:
Pictures.CreateFromFile(UpperLeftColumn, UpperLeftRow, LowerRightColumn, LowerRightRow, FileName)
UpperLeftColumn, UpperLeftRow, LowerRightColumn, and LowerRightRow specify the
location of the picture in the worksheet. FileName specifies the complete path and
name of the file from which you are creating a picture.
Note: Setting the location in the worksheet
of two of the picture's corners may resize the image disproportionately,
distorting the image. To avoid image distortion, use
CreateFromFile2.
The following example demonstrates creating a picture object.
Set Picture = ws.Pictures.CreateFromFile(2, 70, 5, 80, "C:\sample.jpg")
Top |
| CreateFromFile2* |
Creates a Picture
object from an existing image file.
CreateFromFile2 takes three parameters:
Pictures.CreateFromFile2(UpperLeftColumn, UpperLeftRow, FileName)
UpperLeftColumn and UpperLeftRow specify the location in the worksheet of the
image's top left corner. FileName specifies the complete path and
name of the file from which you are creating a picture.
The following example demonstrates creating a picture object.
Set Picture = ws.Pictures.CreateFromFile2(2, 70, "C:\sample.jpg")
Top |
| Item* |
Represents a single Picture object in a Pictures collection.
Item is the default property of Pictures, so Pictures(1) is equivalent to Pictures.Item(1).
Top |
| *This feature is not available in
ExcelWriterSE, ExcelWriterLE, or ExcelWriterFree.
|
Copyright © 2003, SoftArtisans, Inc.