Alaska Software Inc. - IsMembervar with createObject
Username: Password:
AuthorTopic: IsMembervar with createObject
Pascal BoivinIsMembervar with createObject
on Fri, 19 Oct 2012 21:58:41 +0200
Hi

Is there something like IsMembervar for object created with
CreateObject?  IsMembervar always return false for Active/X object.  I
want to omit some code when the user is using old Excel.

oExcel := CreateObject("Excel.Application")
IF IsMemberVar(oExcel, "hwnd")
  //We never get there, but the property exist for Excel 2007 and later
  nWin := oExcel:hwnd
ELSE
  //2003 and previous version
  
ENDIF

Thanks
Pablo Botella NavarroRe: IsMembervar with createObject
on Sat, 20 Oct 2012 20:42:48 +0200
Hi,

You cannot use IsMemberVar() with IDispatch properties because are handled dinamically but you can test for a property with :getIDsOfNames()

oExcel := CreateObject("Excel.Application")
IF oExcel::getIDsOfNames("hwnd") != NIL
   nWin := oExcel:hwnd
ELSE
 //2003 and previous version
  
 ENDIF

Regards,
Pablo
Pascal BoivinRe: IsMembervar with createObject
on Wed, 24 Oct 2012 15:59:30 +0200
Thanks!