Microsoft KB Archive/931395

= Error message when you try to use the ActiveChart.Pictures.Paste method in Excel 2007: &quot;Paste method of Pictures class failed&quot; =

Article ID: 931395

Article Last Modified on 10/15/2007

-

APPLIES TO


 * Microsoft Office Excel 2007

-



SYMPTOMS
When you try to use the ActiveChart.Pictures.Paste method to paste a picture onto a chart in a Microsoft Office Excel 2007 workbook, you receive the following error message:

Run-time error ‘1004’:

Paste method of Pictures class failed



CAUSE
This problem occurs because the Pictures object is not available. The ActiveChart object does not provide a Pictures object in Excel 2007.



WORKAROUND
To work around this problem, use the ActiveChart.Paste method.

Note The ActiveChart.Paste method does not return a picture object. Use the Selection object to obtain the handle to the Picture object.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Steps to reproduce the problem

 * 1) Start Excel 2007.
 * 2) Enter some data in the workbook, and then press F11 to create a new chart.
 * 3) On the Home tab, click Paste, point to As Picture, click Copy as Picture, and then click OK.
 * 4) Press ALT+F11 to start Visual Basic Editor (VBE).
 * 5) On the Tools menu, click Macros.
 * 6) In the Macros dialog box, type Test for in the Macro Name box, and then click Create.
 * 7) Type ActiveChart.Pictures.Paste, and then, click Run Sub/UserForm on the Run menu.

You receive the error message that is mentioned in the symptoms section.

Additional query words: XL2007

Keywords: kbtshoot kbprb kbexpertiseinter kbexpertisebeginner KB931395

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.