在编译以下程序时,由于工作表类的复制方法失败1004,导致我出错。
Sub Macro1()
Dim master As Workbook, awb As Workbook
Dim s1 As String
Dim s2 As String
Dim i As Long, N As Integer
N = 3
Set master = ThisWorkbook
s1 = "C:\Users\Desktop\Test\FTPz.xlsx"
For i = 1 To N
s2 = Replace(s1, "z", CStr(i))
Workbooks.Open Filename:=s2
Set awb = ActiveWorkbook
ActiveSheet.Copy after:=master.Sheets(i)
Next i
End Sub
请任何人帮助解决此问题。