Created
September 28, 2016 21:04
-
-
Save asynxc/49d686bcf0c93f3f986d30b94699db8e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Ubound Alternative Function | |
'MSVBVM60.__vbaUbound | |
Public Declare Function iUBound Lib "MSVBVM60" Alias "__vbaUbound" (ByVal ptr As Long, ByVal Exp As Long) As Long | |
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Long, ByVal Length As Long) | |
Public Function Alternative_UBound(vbv As Variant) As Long | |
Dim a As Long | |
Dim aa As Long | |
a = VarPtr(vbv) + &H8 | |
CopyMemory aa, ByVal a, &H4 | |
CopyMemory a, ByVal aa, &H4 | |
Alternative_UBound = iUBound(&H1, a) | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment