Shapes.AddPicture2 (Excel)

Creates a picture from an existing file. Returns a Shape object that represents the new picture.

AddPicture2 (Filename, LinkToFile, SaveWithDocument, Left, Top, Width, Height, Compress)


Dim strFilename As String: strFilename = 
Dim shpAddPicture2 As Shape
Set shpAddPicture2 = ActiveChart.Shapes.AddPicture2(Filename:=strFilename, LinkToFile:=msoTrue, SaveWithDocument:=msoTrue, Left:=, Top:=, Width:=, Height:=, Compress:=msoPictureCompressDocDefault)

Arguments

The following arguments are required:

Filename (String) - The file from which the OLE object is to be created.

LinkToFile (Office.MsoTriState) - Determines whether the picture will be linked to the file from which it was created.

SaveWithDocument (Office.MsoTriState) - Determines whether the linked picture will be saved with the document into which it is inserted. This argument must be msoTrue if LinkToFile is msoFalse.

Left (Single) - The position, measured in points, of the left edge of the picture relative to the left edge of the worksheet.

Top (Single) - The position, measured in points, of the top edge of the picture relative to the top edge of the worksheet.

Width (Single) - The width of the picture, measured in points.

Height (Single) - The height of the picture, measured in points.

Compress (Office.MsoPictureCompress) - Determines whether the picture should be compressed when inserted.