I'm having a strange problem using the MonthName function. I have code that (among other things) checks to see if a directory exists and then creates it if it doesn't already. The thing is, it works correctly for every month except June; for some reason, the MonthName function spells the month "Jun" rather than "June."
A portion of the code is below...does anyone have any idea what might be causing this?
A portion of the code is below...does anyone have any idea what might be causing this?
Code:
Dim fullDate As Date
Dim numMon As Integer
Dim nameMon As String
Dim filePath, fileName As String
'construct file name and prepare for saving
fullDate = txtBegin.Value
numMon = Month(fullDate)
nameMon = MonthName(numMon)
filePath = "\\corp.confidential.com\userstate\JPowers\Documents\KPI\" & Year(fullDate) & "-" & Format(numMon, "00" & " " & nameMon)
'Create parent directory if it does not already exist
If Dir(filePath, vbDirectory) = "" Then
MkDir filePath
End If
If Dir(filePath & "\RAW", vbDirectory) = "" Then
MkDir filePath & "\RAW"
End If