Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,616
- Office Version
- 365
- 2016
- Platform
- Windows
Consider this code that I am using to create a folder on my D: drive.
Here are some values:
mntxt = "May"
daytext = "Fri"
crtyr = "2023"
filepath = "D:\WSOP 2020\Distributables\2023\May\12 FRI\" --- The path in green already exists.
nfn = "WS 12-May-23.xlsx"
The line in red is giving me a "Path not found Error". Am I using this code wrong?
Rich (BB code):
mntxt = MonthName(Month(inq_date))
daytext = WeekdayName(Weekday(inq_date), True)
crtyr = Year(Now)
filePath = distpath & crtyr & "\" & mntxt & "\" & Format(Day(inq_date), "00") & " " & UCase(daytext) & "\"
nfn = "WS " & Format(inq_date, "dd-mmm-yy") & ".xlsx"
If FolderExists(filePath) = False Then
ui1 = MsgBox("Distributables file for " & Format(inq_date, "dddd mmm-dd") & " does not exist." & Chr(13) & "Create now?", vbInformation + vbYesNo, "Distributables Folder")
If ui1 = vbYes Then
MkDir filePath
Else
Exit Sub
End If
Else
Here are some values:
mntxt = "May"
daytext = "Fri"
crtyr = "2023"
filepath = "D:\WSOP 2020\Distributables\2023\May\12 FRI\" --- The path in green already exists.
nfn = "WS 12-May-23.xlsx"
The line in red is giving me a "Path not found Error". Am I using this code wrong?