May need some more help on how you decide:
- Which financial year we are in (i.e. when does it start - January? April?)
- When you use the full month name (e.g. July) vs. the abbreviation (e.g. Jan)
For example, the below will generate OK for July but not for January if you're using "Jan"
Dim wbCopy As Workbook
Dim TDate As Date
Dim wbMe As Workbook
Dim trans As Integer
Set wbMe = ThisWorkbook
Dim OHS As String
On Error Resume Next
TDate = Date
If Weekday(TDate) = vbMonday Then TDate = TDate - 3
OHS = "K:\Reconciliation Team\client\Year Ending " & Format(TDate, "yyyy") & "\FY" & Format(TDate, "yy mmmm yy") & "\BOI\" & Format(TDate, "d mmmm yy") & "\312 - EPFX Postings\BalanceAndTransactionReport.csv"
On Error GoTo 0
If Dir(OHS) = "" Then
MsgBox "EP report does not exist"
Debug.Print OHS
Exit Sub
End If
Application.DisplayAlerts = False
Set wbCopy = Workbooks.Open(OHS)
WBD
Bookmarks