我正在拔头发。mkdir 适用于年份(整数),但不适用于添加的月份(字符串)。
year = 2013
month = MonthName(1)
'I have also tried just putting "January" in there as well
这有效:
Path1 = "\\TEST\" & year & "\"
但这不会:
Path1 = "\\TEST\" & year & "\" & month & "\"
建议?谢谢!
最终修复:
将 Path1 拆分为:
Path1: "\\TEST\" & year & "\"
Path2: "\\TEST\" & year & "\" & month & "\"
通过检查:
If Len(Dir(Path1, vbDirectory)) = 0 Then
MkDir Path1
End If
If Len(Dir(Path2, vbDirectory)) = 0 Then
MkDir Path2
End If