CopyPicture Method

Applies To

Chart object, ChartObject object, ChartObjects collection object, OLEObject object, OLEObjects collection object, Range object, Shape object.

Description

Copies the selected object to the Clipboard as a picture.

Syntax

expression.CopyPicture(Appearance, Format, Size)

expression Required. An expression that returns an object in the Applies To list.

Appearance Optional Variant. Specifies how the picture should be copied. Can be one of the following XlPictureAppearance constants: xlScreen or xlPrinter. If xlScreen is used, the picture is copied to resemble its display on the screen as closely as possible. If xlPrinter is used, the picture is copied as it will look when it's printed. The default value is xlScreen.

Format Optional Variant. The format of the picture. Can be one of the following XlCopyPictureFormat constants: xlPicture or xlBitmap. The default value is xlPicture.

Size Optional Variant. Used only with Chart objects. The size of the copied picture when the object is a chart on a chart sheet (not embedded on a worksheet). Can be one of the following XlPictureAppearance constants: xlScreen or xlPrinter. If xlScreen is used, the picture is copied to match the size of its display on the screen as closely as possible. If xlPrinter is used, the picture is copied to match its printed size as closely as possible. The default value is xlPrinter.

Remarks

If you copy a range, it must be made up of adjacent cells.

See Also

Copy method, Paste method.

Example

This example copies a screen image of cells A1:D4 on Sheet1 to the Clipboard, and then it pastes the bitmap to another location on Sheet1.

Worksheets("Sheet1").Range("A1:D4").CopyPicture xlScreen, xlBitmap
Worksheets("Sheet1").Paste _
    Destination:=Worksheets("Sheet1").Range("E6")