Is there an equivalent of the C++ sizeof function in VBA?
The only remotely similar functions seem to be the Ubound and LBound operators on arrays.
Dim arr(1 to 4) as integer
MsgBox Ubound(arr)
But this is not really the same thing as the C++ code:
int arr[10];
std::cout << sizeof(std::string) << "\t" << sizeof(arr);
The few pointer-related functions that can be used in VBA are at: http://support.microsoft.com/kb/199824 No obvious equivalent of
sizeofthoughFor an array, you could potentially do something with
VarPtrif you temporarily made the array one item longer and then shrank it back to the desired size: