VARPTR(ptr)

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


ptrThe variant variable.

REMARKS
* This returns the address (or pointer) for a particular variable.
* To return the address of a string, instead of the variable holding the string, pass the string variable using ByVal.
* This function does not appear in the intellisense.
* This function was added in Office 2010.
* This is similar to the OBJPTR
* This is similar to the STRPTR

Dim myLong As Long 
Debug.Print VarPtr(myLong)

Dim myString As String
Debug.Print VarPtr(myString)

Dim myString As String
Debug.Print VarPtr(ByVal myString)

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