Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i identify an MS Excel object type?

I'm using late binding OLE automation to work with Excel. The problem is that I don't know how to work with the value returned by Selection because I don't know what type it is...

How can I determine what kind of object it has returned to me? I'd hope for a type name....

Or must I run through a list of values I'm expecting?

like image 377
X-Ray Avatar asked May 12 '11 20:05

X-Ray


1 Answers

You can cast the object to IDispatch call the GetTypeInfo() method to get a ITypeInfo interface and there you can call the GetDocumentation() method with memid=MEMBERID_NIL to get the name.

like image 119
Matthias Alleweldt Avatar answered Sep 27 '22 23:09

Matthias Alleweldt