Hi all,
Having an issue getting the correct logic to open a file path that changes each month and year, examples below and start of effort.
I am checking if the file exists, and if so, then open
The date at the end of the path needs to be fool proof, so 8 July (d mmm) as well as 08 July (dd mmm)
The FY20 stands for Full Year 2020 which changes monthly, i.e. we are in July now.
K:\Reconciliation Team\client\Year Ending 2019\FY19 July 19\BOI\8 July 19
K:\Reconciliation Team\client\Year Ending 2019\FY19 July 19\BOI\28 July 19
K:\Reconciliation Team\client\Year Ending 2020\FY20 Jan 20\BOI\8 Jan 20
Dim wbCopy As Workbook
Dim TDate As Date
Dim wbMe As Workbook
Dim trans As Integer
Set wbMe = ThisWorkbook
Dim OHS As String
OHS = ""
On Error Resume Next
TDate = Date
Select Case Weekday(TDate)
Case vbMonday
TDate = TDate - 3
End Select
'OHS = "K:\Reconciliation Team\client\Year Ending 2019\FY19 July 19\BOI\8 July 19\312 - EPFX Postings\BalanceAndTransactionReport.csv"")"
OHS = "K:\Reconciliation Team\client\Year Ending 2019\FY19 July 19\BOI\format (tdate, dd mmm yy)\312 - EPFX Postings\BalanceAndTransactionReport.csv"")"
On Error GoTo 0
If OHS = "" Then
MsgBox "EP report does not exist"
Exit Sub
End If
Application.DisplayAlerts = False
Set wbCopy = Workbooks.Open("K:\Reconciliation Team\Baydonhill\Year Ending 2019\FY19 July 19\BOI\format (date, dd mmm yy)\312 - EPFX Postings\BalanceAndTransactionReport.csv")
Thanks for the help in advance
Bookmarks