程序執行時出錯,請幫忙看看
程序執行時提示執行階段錯誤1004,EXCEL無法取用檔案......
Sub Shipping()
Dim MyPath As String
Sheets("shipdata").Select
MyPath = ThisWorkbook.Path & "\shipdata\"
Sheets("shipdata").Copy
ActiveWorkbook.SaveAs MyPath & "shipdata_GSL_" & _
Year(Range("D1")) & "_" & Month(Range("D1")) & "_" & Day(Range("D1")) & ".xls"
With Range("D1")
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
ActiveWorkbook.Save
ActiveWorkbook.Close True
Sheets("shipdata").Select
With Range(Range("B3:D3"), Range("B3:D3").End(xlDown))
.ClearContents
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With
Range("B3").Select
End Sub