ListBox value limit

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
 
J

John

Hi AC,

Thanks for this. I'm curious though, because in another procedure I'm able
to pass a string around so to speak, which is over 9000 characters in
length?

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top