OBJPTR

OBJPTR(ptr)

Returns a LongPtr on a 64 bit version and a Long on a 32 bit version.


ptrThe object variable.

REMARKS
* This returns the address (or pointer) for an interface referenced by an object variable.
* Most objects support multiple interfaces so it is important to get the correct one.
* Often used for indexing objects placed in collections.
* This function does not appear in the intellisense.
* This function was added in Office 2010.
* This is similar to the STRPTR function.
* This is similar to the VARPTR function.

Dim myObject = New myObject 
Debug.Print ObjPtr(myObject)

Dim myCollection As Collection
myCollection.Add myObject, CStr(ObjPtr(myObject))

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top