XL2000: Macro Error Running Recorded Paste Commands

ID: Q199953


The information in this article applies to:
  • Microsoft Excel 2000


SYMPTOMS

When you run a recorded macro that contains copy and paste commands, you may receive the following error message:

Microsoft Visual Basic

Run-time error '1004': Paste method of Worksheet class failed


CAUSE

This error message occurs when you do the following:

  • You start the macro recorder and you cut or copy items.

    -and-


  • You paste using the Clipboard toolbar.



WORKAROUND

When recording macros, do not use the Clipboard toolbar to cut, copy or paste items. Instead use the Cut, Copy and Paste buttons on the Standard toolbar or the Edit menu.


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

When you perform multiple copy commands in any of the Microsoft Office programs, the Clipboard toolbar appears, allowing you to collect and paste multiple items stored in the toolbar. For example, you can copy a chart in Excel, switch to Microsoft Word and copy text, and then switch to Microsoft PowerPoint and paste all of the collected (cut or copied) items from the Office Clipboard.

However, because the Office Clipboard is not included in the Visual Basic for Applications object model, it is not a programmable object in Excel. Therefore, the macro recorder does not recognize actions performed with the Office Clipboard.


REFERENCES

For more information about about the Office Clipboard, click Microsoft Excel Help on the Help menu, type "About collecting and pasting multiple items" in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Additional query words: XL2000 collect and copy

Keywords : kbtool kbdta xlvbainfo
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: June 10, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.