I don't have time to try to work out what you are trying to achieve here. If you want to populate an ActiveX combo from a Userform List, why not just write the selected items to a dynamic range and load the combo from that as the RowSource?
Printable View
I don't have time to try to work out what you are trying to achieve here. If you want to populate an ActiveX combo from a Userform List, why not just write the selected items to a dynamic range and load the combo from that as the RowSource?
Till this amendment we all were so far from essence of the question either as ComboBox is far from KlitschkoBox :)Quote:
Originally Posted by asystole0
So, for referencing to the property/method of ActiveX control embedded into the sheet, just insert Object keyword between control's code name and its property/method, like this:
Sheet5.ComboBox15.Object.List = ...
This works for UserForm_Initialize code of RatesPuller form of your example:Regards,Code:
' Code of RatesPuller userform
Private Sub UserForm_Initialize()
' Next line is for debugging only, in real task call FillList() for populating of the userform's ListBox5
ListBox5.List = Array("SainsLabour", "SainsLabourPrice", "SainsMaterials", "SainsMaterialPrices", "SainsEquipment", "SainsEquipmentPrices")
' Copy list of RatesPuller form's ListBox5 to the ComboBox15 embedded into the sheet Contract
Sheets("Contract").ComboBox15.Object.List = ListBox5.List
End Sub
Vladimir
Thanks Vladmir, I can see how that works, I dont think i was that for off!!!Quote:
Originally Posted by ZVI
Now I get "runutime error '70' - permission denied", Do I need to make the comboBox editable before trying to fill it with the contents from the list box?
That code worked for me. Is your sheet protected, or does your combo have a row source property already set?
The questions:Quote:
Originally Posted by asystole0
1. The code of post #22 being copied into your example of post#18 is working without error, isn’t it? - Please confirm.
2. So, what is the problematic code?
3. Which line of the code debugger highlights with error messaging?
4. What do you mean saying "make the comboBox editable "?