A family of Microsoft word processing software products for creating web, email, and print documents.
Will this work for Word?
I cannot use
Dim MyDropDown As OLEObject
Compile error: User -defined type not defined
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Below is a very simplified code representing my problem. I am trying to create comboboxes with lists and then separately set the value. The user can accept the pre-defined value or select from the list. I don't always want the first item in the list to be the value.
Option Explicit
Dim MyDropDown As Object
Dim MyList as Variant
Sub test()
MyList = Array("","apple", "orange", "banana")
MyDropDown.List = MyList
MyDropDown.Value = "orange"
End Sub
I get an error that tells me the object variable is not set.
Do I need something like this:
Set MyDropDown = New ???
(I don't see ComboBox as an option)
I am totally missing something here.
thanks
A family of Microsoft word processing software products for creating web, email, and print documents.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Will this work for Word?
I cannot use
Dim MyDropDown As OLEObject
Compile error: User -defined type not defined