I'm looking for some code to activate and close a workbook with a dynamic name.
Eg. I have a workbook, BOOK1.xls with a macro that opens a 2nd workbook, DYNAMIC-NAME.xls based on a name selected from a userform: eg.
Code
file_dir2 = "C:\data\dailydata\"
File_Name2 = file_dir2 & Me.CmbStationName.Text & ".xls"
Workbooks.Open File_Name2
After opening DYNAMIC-NAME.xls, I reactivate BOOK1 for editing. I then need to close the DYNAMIC-NAME.xls.
I've tried
and
to no avail
Any ideas?
Cheers,
Flick.