Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: Macro Error Running Recorded Paste Commands


View products that this article applies to.

This article was previously published under Q199953

↑ Back to the top


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

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


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.

↑ Back to the top


References

For more information 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.

↑ Back to the top


Keywords: KB199953, kbprb

↑ Back to the top

Article Info
Article ID : 199953
Revision : 3
Created on : 9/25/2003
Published on : 9/25/2003
Exists online : False
Views : 308