has anyone used the combobox.rowsource to populate the combobox with a range from and Excel file? Is it possible? Or do I need to stick to the AddItem method?
Should be possible, check these two link:
Excel VBA UserForm Combobox Populate using Rowsource and Range Name
Excel Userform Combobox Properties Rowsource box issues?
Thanks Deepak, I'll give those a go when I get into the office tomorrow. So far my code has hung at rowsource stating syntax issues, but nothing I've found/tried has worked.
Share your codes to make i easier to debug.
I will do. Or if I get it going I'll share that to.
no joy unfortunately. The code which seems to get the through the most gates seems to be
Private Sub UserForm_Initialize()
Dim objExcel As Object
Dim lngCnt As Long
Dim lngRowCount As Long
'Create an Instance of Excel
Set objExcel = CreateObject("Excel.Application")
'Open your Excel File
objExcel.Workbooks.Open "D:Bjorn\Temp\Custom Property Fields.xlsx", , True 'Open Read-Only
'Show the SpreedSheet
objExcel.Visible = False
RevStat_Combo.RowSource = "Sheet1!M2:M6"
however it either doesn't like the data, or the way it's getting it.
So no joy on finding any solution to the rowsource method. Found a few forums suggesting .rowsource is not reliable and to use .list. No joy getting that working either.
But I've come along this post which has a working solution to getting the values I require . https://forum.solidworks.com/message/284913#comment-284913
Retrieving data ...