Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27229

Cannot Set object for ListBox

$
0
0
Hi everybody. I have an application that uses VBA in Excel to access values in ComboBox and ListBox.

Here is the code for ComboBox:
Code:

Dim myCB As ComboBox
Set myCB = UserForm1.ComboBox1

Then I have a custom API that takes myCB as an argument.
The above works fine, but using ListBox fails. Code:
Code:

Dim myLB As ListBox
Set myLB = UserForm1.ListBox1

The Set command throws a Type Mismatch error. Why?
(Yes, I have both a Combobox and ListBox in my form)

Any help here would be jolly good.
Thanks,

Viewing all articles
Browse latest Browse all 27229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>