XL5: PasteSpecial Method (Range Object) Example Incorrect

Last reviewed: September 12, 1996
Article ID: Q124090
The information in this article applies to:
  • Microsoft Excel for Windows, version 5.0

SYMPTOMS

In Microsoft Excel 5.0, in Visual Basic Reference Help, the example for the PasteSpecial Method (Range Object), returns the following error message when you use it in a procedure:

   Run-time Error 1004:
   PasteSpecial method of Range class failed

NOTE: Page 486 of the Microsoft Press book "Microsoft Excel 5 Visual Basic for Applications Reference," contains the same incorrect example.

CAUSE

This error occurs because the "add" argument in the PasteSpecial command is incorrect. The correct argument is "xlAdd."

RESOLUTION

When you use this example in a macro, replace the word "Add" in the PasteSpecial command with the word "xlAdd," as in the following example:

   Range("D1:D5").PasteSpecial operation:=xlAdd

STATUS

Microsoft has confirmed this to be a problem in Microsoft Excel version 5.0. This problem has been corrected in Microsoft Excel version 5.0c.


KBCategory: kbprg kbcode kbdocerr
KBSubcategory:

Additional reference words: 5.00 5.00a PasteSpecial failed



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.