Traditional method: To find the length of an existing byte array:
nLen = UBound(abData) - LBound(abData) + 1
Be careful, as this will cause a run-time error if abData()
has not been ReDim'd.
Safer method: Use the VBA wrapper function cnvBytesLen.
Dim ab() As Byte Debug.Print cnvBytesLen(ab) ' Expecting 0 ReDim ab(10) ' NB actually 11 elements (0..10) Debug.Print cnvBytesLen(ab) ' 11