Question : Runtime Error 424 "Object Required"

Hi I have this error whenever I open my spreadsheet.  The debuger then opens this code highlighting Line 7

It only happens each time I close and reopen the spreadsheet.

Thanks.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
Private Sub ListBox1_Change()
Dim CustNm As String
 
If ListBox1.ListIndex = -1 Then
Label1.Caption = ""
Else
CustNm = ListBox1.Value
Label1.Caption = ListBox1.Value
endrow = Sheets(CustNm).Range("A65536").End(xlUp).Row
Listbox2.ListFillRange = "'" & CustNm & "'!A2:F" & endrow + 1
 
End If
End Sub

Answer : Runtime Error 424 "Object Required"

I would think about rebuilding your workbook. I deleted Label1 and recreated it, then the code got past that and halted with the same error on the ListBox2 line (even though I had previously checked that ListBox2 showed up as a member of the worksheet's controls), so I suspect there may be some corruption creeping in.

Regards,

Rory

Random Solutions  
 
programming4us programming4us