Difference between VBA.CBlah and CBlah
问题 Weird observation: Normally when I want to save an address to a function in a variable, I do something like this: Function getAddress(ByVal func As LongPtr) As LongPtr getAddress = func End Function Sub printAddress() Dim functionPointer As LongPtr functionPointer = getAddress(AddressOf myFunc) Debug.Print functionPointer End Sub However I just discovered I can use a 1-liner functionPointer = VBA.CLngPtr(AddressOf myFunc) while functionPointer = CLngPtr(AddressOf myFunc) ... does not work and