Kelvin Stott
Active Member
- Joined
- Oct 26, 2010
- Messages
- 338
Hello,
I have written the following function in VBA, which converts a 1-dimensional data array into a text string by concatenating successive data points separated by a comma. The string is defined as variable length with no fixed limit, and I had understood this should allow for about 2 billion characters, but the function generates an error ("wrong data type") as the string exceeds about 64,000 characters. Is there any way to extend/avoid this limit?
Thanks for any help with this!
Best regards,
Kelvin
I have written the following function in VBA, which converts a 1-dimensional data array into a text string by concatenating successive data points separated by a comma. The string is defined as variable length with no fixed limit, and I had understood this should allow for about 2 billion characters, but the function generates an error ("wrong data type") as the string exceeds about 64,000 characters. Is there any way to extend/avoid this limit?
Code:
Function DSTORE(DArray)
'Converts a 1-dimensional data array into a text string, with successive data points separated by a comma
Dim d As Long
Dim DText As String 'Variable length string with no fixed limit
For d = LBound(DArray) To UBound(DArray)
DText = DText & DArray(d) & ","
Next d
DSTORE = DText
End Function
Thanks for any help with this!
Best regards,
Kelvin