Shapes.AddPicture2 Method (Excel)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

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

expression .AddPicture2(FileName, LinkToFile, SaveWithDocument, Left, Top, Width, Height, compress)

expression A variable that represents a Shapes object.

Parameters

Name

Required/Optional

Data Type

Description

FileName

Required

String

The file from which the OLE object is to be created.

LinkToFile

Required

MsoTriState

Determines whether the picture will be linked to the file from which it was created.

SaveWithDocument

Required

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

Required

Single

The position, measured in points, of the left edge of the picture relative to the left edge of the worksheet.

Top

Required

Single

The position, measured in points, of the top edge of the picture relative to the top edge of the worksheet.

Width

Optional

Single

The width of the picture, measured in points.

Height

Optional

Single

The height of the picture, measured in points.

compress

Optional

MsoPictureCompress

Determines whether the picture should be compressed when inserted.

Return Value

Shape

Concepts

Other resources

Show: