Results 1 to 7 of 7

Thread: [RESOLVED] Error on filling ComboBox from Excel named range.

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2006
    Posts
    82

    Resolved [RESOLVED] Error on filling ComboBox from Excel named range.

    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:


    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
    I also tried selecting the range which also gives an error.

    Code:
    Excel_VSA_NEW.OWS.Range("rng_VsaStatus_main").Select()
    Name:  devenv_xDVnDFL4Le.jpg
Views: 1966
Size:  10.8 KB
    Last edited by ZviT; Jan 20th, 2021 at 03:11 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width