Roy,
here is my updated code
Dim oWbk As Workbook
Dim rdata As Range
Application.ScreenUpdating = False
'check if workbook containing source is open if not open it.
If Not Workbooks.Open("W:\WC\Forms\WORKCENTERLIST.xls") Then
Set oWbk = Workbooks.Open("W:\WC\Forms\WORKCENTERLIST.xls")
Else: Set oWbk = Workbooks("W:\WC\Forms\WORKCENTERLIST.xls")
End If
'this is the data to load to combobox
Set rdata = oWbk.Worksheets("Sheet1").Range("B5:B41")
With Me.ComboBox5
.Clear 'clear any previous data
.Style = fmStyleDropDownList
.BoundColumn = 0
'set RowSource
.RowSource = rdata.Address(external:=True)
'0 = no selection
.ListIndex = 0
End With
Set oWbk = Nothing
Set rdata = Nothing
Application.ScreenUpdating = True
the first line that causes an error when using step into is
Set oWbk = Workbooks.Open("W:\WC\Forms\WORKCENTERLIST.xls")
Bookmarks