All of a sudden getting an error with newly created UserForms with ComboBoxes

philfloyduk

Board Regular
Joined
Jan 6, 2011
Messages
82
I'm currently making changes to repair booking spreadsheet and I've started getting an error message on new forms created when trying to the the .list information in ComboBoxes. I have lots of ComboBoxes already that I've created in previous days that work fine but all of a sudden I get an error when creating new forms. I've tried inserting a blank form and adding a combobox to see if that works but I get the same error:

Run-time error '381
'Could not set the List property. Invalid property array index'.

I'm using the following code to set the list property;

ComboBox1.List = Sheets("info").Range("a1:a4").value

Any help will be much appreciated

Thanks in advance

Phil
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Phil

I was going to suggest you check if the RowSource has been set elsewhere but if these are newly created comboboxes then that would be unlikely.

Rather than List have you considered actually using RowSource?
Code:
Combobox1.RowSource = "Info!A1:A4"
Or even something like this.
Code:
Worksheets("Info").Range("A1:A4").Name = "ComboDataList"
 
ComboBox1.RowSource = "ComboboDataList"
 
Upvote 0
Hi Norie and thank you!

Is there any reason why the method I've used in the rest of the forms I've created worked before but not when I'm creating new ones now? Your method has solved the problem which is obviously the most important thing but it seems odd to me?

Thanks again


Phil
 
Upvote 0
Phil

As far as I can see what you have should work.

Are you sure there wasn't anything going on with the RowSource property when your code didn't work?

The code I posted is just basically setting that property, and if there had been a problem with it previously that might be why it works.

Hard to tell without more info, eg is there any other code.
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top