This can be done, and I seem to be referring to this other thread a lot lately.
check this post, http://www.excelguru.ca/forums/showt...ht=consolidate
You can use the File Scripting Object as Ken explains in the post.
Hello everyone
I am trying to write a macro that opens a workbook which is in a specific location. The workbook changes name regularly according to the date it is saved on. But there is only one *.xls file at this location. The location is E:\Reports. The latest filename is 11-3-2014.xls. My attempts doing this have failed so far. ? I would very much like the macro to find this *.xls file and open it, whatever the name will be.
Can anyone help?
Brg. Not an excel guru![]()
This can be done, and I seem to be referring to this other thread a lot lately.
check this post, http://www.excelguru.ca/forums/showt...ht=consolidate
You can use the File Scripting Object as Ken explains in the post.
Code:Sub OpenFileNoName() fpath = "E:\Reports\" FoundFile = Dir(fpath & "*.xls") If FoundFile <> "" Then Workbooks.Open (fpath & FoundFile) Else MsgBox "No such file!" End If End Sub
Bookmarks