I run a series of reports every day and they are saved in a folder based on the date. For example: C:\Users\Desktop\Test\Current\2020 08 05\Report_Name 2020 08 05.xlsx
The following day I run the new reports and move the "2020 08 05" folder to an Archive. But the new reports pull data from the previous day's report, so I need to open it without specifying the dated folder name.
I've tried using a wildcard, but that doesn't work.
Sub OpenReport()
Dim sFound As String
Dim Path As String
Path = "C:\Users\Desktop\Test\Current\*\"
sFound = Dir(Path & "\Report_Name*.xlsx")
If sFound <> "" Then
Workbooks.Open Filename:=Path & "\" & sFound
End If
End Sub