|
n = 1
If Dir("\\192.168.116.162\g:\文\" & Year(Date), vbDirectory) <> "" Then
Else
MkDir "\\192.168.116.162\g:\文\" & Year(Date)
End If
If Dir("\\192.168.116.162\文\" & Year(Date) & "\" & Month(Date) & "月", vbDirectory) <> "" Then
Else
MkDir "\\192.168.116.162\文\" & Year(Date) & "\" & Month(Date) & "月"
End If
If Dir("\\192.168.116.162\文\" & Year(Date) & "\" & Month(Date) & "月" & "\" & Day(Date) & "日", vbDirectory) <> "" Then
Else
MkDir "\\192.168.116.162\文\" & Year(Date) & "\" & Month(Date) & "月" & "\" & Day(Date) & "日"
End If
TStr = "\\192.168.116.162\文\" & Year(Date) & "\" & Month(Date) & "月" & "\" & Day(Date) & "日" & "\" & "(" & Format(Date, "YYYY-M-D") & "-" & Format(Time, "HHMM") & ")" & ActiveSheet.Cells(3, 6) & ActiveSheet.Cells(2, 6) & " 记录" & "-" & n & ".xls"
Do While Len(Dir(TStr))
n = n + 1
TStr = "\\192.168.116.162\文\" & Year(Date) & "\" & Month(Date) & "月" & "\" & Day(Date) & "日" & "\" & "(" & Format(Date, "YYYY-M-D") & "-" & Format(Time, "HHMM") & ")" & ActiveSheet.Cells(3, 6) & ActiveSheet.Cells(2, 6) & " 记录" & "-" & n & ".xls"
Loop
ThisWorkbook.SaveAs Filename:="\\192.168.116.162\文\" & Year(Date) & "\" & Month(Date) & "月" & "\" & Day(Date) & "日" & "\" & "(" & Format(Date, "YYYY-M-D") & "-" & Format(Time, "HHMM") & ")" & ActiveSheet.Cells(3, 6) & ActiveSheet.Cells(2, 6) & " 记录" & "-" & n & ".xls"
|
|