PRB: Paste Link Fails in Microsoft Excel (141440)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++ 1.51
- Microsoft Visual C++ 1.52
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 2.0
- Microsoft Visual C++, 32-bit Professional Edition 2.1
- Microsoft Visual C++, 32-bit Professional Edition 2.2
- Microsoft Visual C++, 32-bit Professional Edition 4.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Learning Edition 4.0
This article was previously published under Q141440 SYMPTOMS
After you attempt to use Paste Link to paste the clipboard contents into
Microsoft Excel, Microsoft Excel fails and displays a warning:
Unable to paste link.
CAUSE
When Microsoft Excel attempts to paste link an object, it looks for a full
moniker for the object (OLEWHICHMK_OBJFULL). The full moniker consists of
the moniker of the object's container (OLEWHICHMK_CONTAINER) and the
moniker of the object relative to its container (OLEWHICHMK_OBJREL). In
MFC, if SetItemName() is not used to provide a name for the COleServerItem,
the OLEWHICHMK_OBJREL portion of the moniker cannot be provided. This
causes Paste Link to fail in Microsoft Excel.
RESOLUTION
Set the name of the item to be paste linked by using the SetItemName()
function. The sample code in this article illustrates one way you might do
this.
STATUS
This behavior is by design.
REFERENCES
For more information, see COleServerItem::XOleObject::GetMoniker() in
Olesvr2.cpp and IOleObject::GetMoniker() in the OLE 2 Programmer's
Reference.
Modification Type: | Major | Last Reviewed: | 12/1/2003 |
---|
Keywords: | kbClipboard kbprb KB141440 |
---|
|