Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help! Excel pastes in "shape" format
I am debugging a huge application (which, among others, integrates in Excel
and other Office products) for a bug in which Copy-Paste doesn't work as expected. Here's what the application does: - Added its window to the chain of clipboard viewers - On "Copy" (when it receives WM_DRAWCLIPBOARD), it passes control to a COleDataSource-derived class, which then retrieves a data object from the Clipboard through OleGetClipboard(), and then iterates through the formats supported by the data object. - If the formats it supports are Biff8, Embedded Object, Link Source, or Link Source Descriptor - which were all registered with RegisterClipboardFormat() - then it fills in, in the proper format, the data into the provided STGMEDIUM. - Then, on "Paste", Excel asks (the COleDataSource-derived class, by means of OnRenderData()) for the formats: Link Source Descriptor, then Link Source, and Link Source Descriptor again, and the application fills those into the provided STGMEDIUMs again. - But after the paste is done, what actually got pasted by Excel is a shape object (with the round knobs to rotate and resize it). Although in the formula bar I can see the correct content (a formula containing a moniker to the cell that I copied in the first place) and the text in the shape object is the text that was linked from a different workbook's cell. So the BIG question is: Why does Excel paste the object as a shape, although the data that was rendered was fine, and in the format required by Excel? What I want is for Excel to paste the formula in the cell, and then the evaluation will work (as it works now) and fill the content of the cell with the result of the evaluation. Anybody who has an answer? I would greatly appreciate any thought on this issue, since it has made me tired with research. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
copy data from one sheet to another "entry has to be same shape" | Excel Discussion (Misc queries) | |||
Excel 2007 PivotTable "arbitrary shape is not allowed when its elements cross a reference dimension" | Excel Discussion (Misc queries) | |||
Align a picture/shape in the middle of a range("A1:H10") | Excel Programming | |||
Align a picture/shape in the middle of a range("A1:H10") | Excel Programming |