Microsoft KB Archive/928983

= Error message when you run a VBA macro that uses the &quot;Insert&quot; method or the &quot;AddPicture&quot; method to insert a picture in Excel 2007: &quot;Application-defined or object-defined error&quot; =

Article ID: 928983

Article Last Modified on 10/15/2007

-

APPLIES TO


 * Microsoft Office Excel 2007

-



SYMPTOMS
You run a Microsoft Visual Basic for Applications (VBA) macro that uses the Insert method or the AddPicture method to insert a picture in a worksheet in Microsoft Office Excel 2007. When you do this, the picture is not inserted. Additionally, you receive the following error message:

Run-time error '1004':

Application-defined or object-defined error



CAUSE
This issue may occur if the picture is located in an HTTP location.



WORKAROUND
To work around this issue, code the VBA macro to insert the picture as a picture fill in a shape such as a rectangle.

Additional query words: excel2007 excel2k7 excel12 xl2007 xl2k7 xl12

Keywords: kberrmsg kbtshoot kbmacro kbprogramming kbautomation kbprb kbgraphic kbvba kbexpertisebeginner KB928983

-

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

© Microsoft Corporation. All rights reserved.