Hi all, found another one that I've been banging my head on...
So, I have an Add-In (named "My Add-in.xlam") that I use for dynamic file lists and the like. The sheet name is "ValidationSheet". I have a combobox that is in my userform that is named "cbSegSelect" and I can't find the right syntax for setting the combobox list. The data is in cells E7:E22 (but the list lenght with grow).
So to start, I use the following vba code to assign RowSource
This works, but gives me the values from the active sheet. But I'm using an add-in, so ValidationSheet isn't the active sheet.
So I try
And it faults. I get the error Run Time Error #380; Could not set the RowSource property. Invalid property value.
So I thy to create the addressing direct from code so I don't do any typos:
Same errors.
But all these work!
Only 2012.prn is the active workbook, not the Add-In!
In the Properties window it will take "E7:E22", but it won't take anything that points to the add-in sheet. Both of these fail:
I Must be missing something pretty simple, but I just don't know what!
Matt
So, I have an Add-In (named "My Add-in.xlam") that I use for dynamic file lists and the like. The sheet name is "ValidationSheet". I have a combobox that is in my userform that is named "cbSegSelect" and I can't find the right syntax for setting the combobox list. The data is in cells E7:E22 (but the list lenght with grow).
So to start, I use the following vba code to assign RowSource
Code:
cbSegSelect.RowSource = "E7:E22"
So I try
Code:
cbSegSelect.RowSource = "[My Add-in.xlam]ValidationSheet!E7:E22"
So I thy to create the addressing direct from code so I don't do any typos:
Code:
cbSegSelect.RowSource = "[" & ThisWorkbook.Name & "]" & ThisWorkbook.Sheets(1).Name & "!E7:E22"
But all these work!
Code:
cbSegSelect.RowSource = "Sheet1!E7:E22"
cbSegSelect.RowSource = "[2012.prn]Sheet1!E7:E22"
In the Properties window it will take "E7:E22", but it won't take anything that points to the add-in sheet. Both of these fail:
- [My Add-in]ValidationSheet!E7:E22
- [My Add-in.xlam]ValidationSheet!E7:E22
- E7:E22
- Sheet1!E7:E22
I Must be missing something pretty simple, but I just don't know what!
Matt
Last edited: