Hi guys!
How to get range of embedded ole excel object which one is copy-paste into modelspace?
Thanks.
Hi,
Sorry for the long delay.
Do you mean after you copy a range of cell in Microsoft excel, you want to get the selected range even before it is pasted in AutoCAD ?
In that case, you may try this approach. Please note that I have not tried it to be sure if it works.
First get access to a AcDbOle2Frame. As there is no API to create a Ole2Frame, you may have to import it from another drawing file that has this Ole object.
Use the AcDbOle2Frame::getOleClientItem to access the "COleClientItem" class instance.
Use the "COleClientItem::CreateFromClipboard" to initialize the OleClientItem from the data copied in the clipboard.
Use the AcDbOle2Frame.getOleObject which should provide the excel workbook.
You can then use the Microsoft Excel API to get access to its cells.
Regards,