0
下面的代碼有什麼問題?我收到運行時1004錯誤。運行時需要1004錯誤協助
Sub Save_CSV()
'
' Save_CSV Macro
'
'
Columns("A:K").Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ThisWorkbook.SaveAs Filename:= _
"G:\Business & Facility\Finance\Finance Documents\Payroll Journal\EH Payroll Journal IMPORT.csv" _
, FileFormat:=xlCSV, CreateBackup:=False
Windows("EH Payroll Journal TEMPLATE Xero.xlsm").Activate
End Sub
您不清楚哪條線收到1004錯誤。但是,在代碼中顯然有一些事情可以修復,這將幫助您避免該錯誤和其他錯誤...閱讀[this](http://stackoverflow.com/documentation/excel-vba/1107/vba- best-practices/9292/avoid-using-select-or-activate#t = 201703070253108353635)and [this](http://stackoverflow.com/documentation/excel-vba/1107/vba-best-practices/11274/always -define和設置引用到的所有的工作簿和表#T = 201703070253108353635)。 – PeterT