Belleke
Well-Known Member
I fill a userform listbox with this code
LB1 is a the listbox
Attendance is the folder
Then I use this to open a workbook.
I get an error msg, it keeps on saying Could not find file .....
What am I missing
Code:
MyFolder = ThisWorkbook.Path & "\Attendance"
MyFile = Dir(MyFolder & "\*.xlsm")
Do While MyFile <> ""
LB1.AddItem MyFile
MyFile = Dir
Loop
Attendance is the folder
Then I use this to open a workbook.
Code:
Private Sub LB1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Workbooks.Open ThisWorkbook.Path & "\Attendance" & "\ " & LB1
Unload Me
End Sub
What am I missing