I want to open a file "Account Master mmddyy.xls" which gets saved at a particular path, every month only date and month changes. How can I open the file with wild card using "Account Master" as that will be consistent. Only 1 file will be saved at this location with similar file name.
I tried this but it didn't work.
Sub open_file()
Workbooks.Open Filename:="C:\Users\Desktop\WORK\Account Master*"
End Sub
Try this:
Sub open_file()
Dim sFilename As String
sFilename = Dir("C:\Users\Desktop\WORK\Account Master*", vbArchive)
Workbooks.Open Filename:=sFilename
end sub
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.