UserPicture method (Excel Graph)

Fills the specified shape with an image.

Syntax

expression.UserPicture (PictureFile, PictureFormat, PictureStackUnit, PicturePlacement)

expression Required. An expression that returns one of the objects in the Applies To list.

Parameters

Name Required/Optional Data type Description
PictureFile Required Variant The name of the specified picture file.
PictureFormat Optional XlChartPictureType The format of the specified picture. Can be one of the XlChartPictureType constants.
PictureStackUnit Optional Variant The stack or scale unit for the specified picture (depends on the PictureFormat argument).
PicturePlacement Optional XlChartPicturePlacement The placement of the specified picture. Can be one of the XlChartPicturePlacement constants.

Example

This example sets the chart's fill format so that it's based on a user-supplied picture.

With myChart.ChartArea.Fill 
 .UserPicture PictureFile:="C:\My Documents\brick.bmp" 
 .Visible = True 
End With

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.