ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

get range of embedded ole excel object

1 REPLY 1
Reply
Message 1 of 2
Anonymous
592 Views, 1 Reply

get range of embedded ole excel object

Hi guys!

How to get range of embedded ole excel object which one is copy-paste into modelspace?

Thanks.

1 REPLY 1
Message 2 of 2
Balaji_Ram
in reply to: Anonymous

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,

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost