A family of Microsoft word processing software products for creating web, email, and print documents.
When something works everywhere except one document, the problem is most likely in that document, not in the program or the operating system. A "Command Failed" error is Microsoft's catch-all for "the thing you're trying to paste can't be put into the document at the place where you're trying to put it, but I don't know exactly why".
The investigation goes something like this:
- Try manually pasting different things at the same place in the document.
- If that works, maybe the problem is the clipboard's content during the macro run. Using the Debug menu in the macro editor, set a breakpoint to stop after the item is copied but before it's pasted; then switch to the document body and try manually pasting.
- If the error occurs then, try pasting the clipboard content into a new blank document. Exactly what is in it, including nonprinting characters (show with the ¶ button on the Home ribbon)?
- It may also help to know exactly where in the document the macro "thinks" it's pasting. Insert a statement to select the pasting location and then stop executing. Where in the document is the selection?
If you can determine what conditions cause the error -- an invalid character on the clipboard, or trying to paste a control inside another control, or some other mismatch of the clipboard item and the document content -- then you should add code to the macro to avoid trying to do that.