Paddy...replace your code with this below
Run it.
Click on your command1 button
What number appears in the msgbox when it runs?
Code:Option Explicit Dim oExcel As Excel.Application Dim wkobj As Excel.Worksheet Dim wkbobj As Excel.Workbook Private Sub Command1_Click() List1.Clear Set wkbobj = GetObject("F:\Machine info for HQ and FQ Shrink Tunnel.xlsx") Dim i As Integer, numrows As Integer numrows = wkbobj.Worksheets(1).Range("A1").CurrentRegion.Rows.Count MsgBox numrows For i = 1 To numrows List1.AddItem (wkbobj.Worksheets(1).Range("A" & i).Value) 'where "A" is the column you want loaded Next i End Sub Private Sub Command2_Click() List1.Clear List1.AddItem ("Good by") List1.AddItem ("Adios") End Sub




Reply With Quote