G
George
Sub ExcelToListBox()
Dim xRange As Object
Dim ary
Dim xValue As String
xRange = oXL.Range("A1:A9") 'has letters A-H
ary = xRange.value
xValue = ary(3, 1) 'xValue = C
Me.ListBoxPerson.Items.AddRange(ary)
This AddRange causes error message:
'An unhandled exception of type
'System.Reflection.AmbiguousMatchException' occurred in
microsoft.visualbasic.dll
'Additional information: No accessible overloaded
'ObjectCollection.AddRange' can be called without a narrowing
conversion.
End Sub
Questions:
Is there a difference between these two:
Dim ary
Dim ary as System.Array
What is the syntax for the AddRange? I've tried various combinations.
Thanks,
George
Dim xRange As Object
Dim ary
Dim xValue As String
xRange = oXL.Range("A1:A9") 'has letters A-H
ary = xRange.value
xValue = ary(3, 1) 'xValue = C
Me.ListBoxPerson.Items.AddRange(ary)
This AddRange causes error message:
'An unhandled exception of type
'System.Reflection.AmbiguousMatchException' occurred in
microsoft.visualbasic.dll
'Additional information: No accessible overloaded
'ObjectCollection.AddRange' can be called without a narrowing
conversion.
End Sub
Questions:
Is there a difference between these two:
Dim ary
Dim ary as System.Array
What is the syntax for the AddRange? I've tried various combinations.
Thanks,
George