I'm trying to fill a Combobox with values from a named range in excel and can't figure out why I'm getting an error in the For loop. Here's my code:
I also tried selecting the range which also gives an error.Code:Public Sub FillAlbumStatusCombo(ByVal Excel_VSA_NEW As Class_Excel_Files) ComboBox_VsaStatus.Items.Clear() Excel_VSA_NEW.OWS = Excel_VSA_NEW.OWBa.Worksheets("INTERNAL") For Each cell As Excel.Range In Excel_VSA_NEW.OWS.Range("rng_VsaStatus_main").Cells ComboBox_VsaStatus.Items.Add(cell.Value.ToString) Next End Sub
Code:Excel_VSA_NEW.OWS.Range("rng_VsaStatus_main").Select()![]()




Reply With Quote
