View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John[_88_] John[_88_] is offline
external usenet poster
 
Posts: 205
Default ListBox value limit

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