J
John
Hi there,
I've come across a weird issue with listbox value sizes. The code below
adds an item to the list, that increments one character at a time. However,
it falls over with a "2147352571 - Type mismatch" error. The length of the
string at that stage is 2048. Can anyone tell why this is happening?
Thanks
John
Private Sub UserForm_Initialize()
Dim sCharacters As String
For X = 1 To 3000
sCharacters = sCharacters & "a"
Me.ListBox1.AddItem sCharacters
Debug.Print CStr(Len(sCharacters))
Next X
End Sub
I've come across a weird issue with listbox value sizes. The code below
adds an item to the list, that increments one character at a time. However,
it falls over with a "2147352571 - Type mismatch" error. The length of the
string at that stage is 2048. Can anyone tell why this is happening?
Thanks
John
Private Sub UserForm_Initialize()
Dim sCharacters As String
For X = 1 To 3000
sCharacters = sCharacters & "a"
Me.ListBox1.AddItem sCharacters
Debug.Print CStr(Len(sCharacters))
Next X
End Sub