Luis Carrion said:
I think it's like saying that the string variable will have 128
characters long. Strings variables can hold up to 256 characters but
it's deliminting its storage to 128 characters. Mostly used when
getting information from API's.
The string size limit is much much greater. I thought it was 32k or
even 64k but it seems to be a bit bigger.
You can put this code into a spreadsheet to verify this:
Private Sub cmdTest_Click()
Dim strText As String, strMsg$
Dim i As Long, x&, strErr$
On Error GoTo LocalErr
For i = 1 To 66000
x = i Mod 10
strText = strText & CStr(x)
If i = 32000 Then
strMsg = "Length of strText: " & CStr(Len(strText)) & vbCrLf & _
"i = " & CStr(i)
MsgBox strMsg
End If
Next i
strMsg = "Length of strText: " & CStr(Len(strText)) & vbCrLf & _
"i = " & CStr(i)
MsgBox strMsg
Exit Sub
LocalErr:
MsgBox i
Err.Clear
End Sub
The most you can type into a line at a time is maybe 256 characters.
But you can always do strText = strText & "Another 256 characters"
to get more text into the string.