1
votes

I have an excel file which has two comboboxes in which Combobox1 lists out the names of the States in US and Combobox2 will list only those Counties in the State selected in Combobox1.My code is working fine and only those Counties for the State selected are showing up in the second combobox. Now my concern is that,once I open or close the Excel after saving, it throws a compile error for my Combobox2 as "Method or data memeber not found". Code is such that for the Change event of Combobox1,the Listfillrange property is filled as a named range based on selection in combobox1.Even if the code works it throws this error while opening and closing if the workbook.Also one thing I noticed is that if we open VBA editor in the woeksheet where Combobox is created I could see just Combobox1 if we dropdown the object list and unable to find Combobox2.But once we change Combobx1 and combobx2 values in Worksheet it appears in the dropdown list in VBE Editor. If Combobox1 appears without any issues what is happening with Combobx2?

Both the comboboxes are Activex Control.I can't figure out whats happening with Combobox2 while compiling.

It would be really helpful, if someone could help me on this issue.

Thanks, Merin.

1

1 Answers

1
votes

Yes I have see this error before :)

The resolution is to set the .ListFillRange to null right before the line where you set the .ListFillRange range. I had answered a similar question few days ago. Let me search for the link. :)

EDIT

Ok Found it :)

Topic: old excel 97 code in excel 2010

Link: http://social.msdn.microsoft.com/Forums/en/exceldev/thread/b2619a55-a093-482e-a34d-9f059f73c21f