如何使用Worksheet.Add
函數從外部工作簿添加工作表?使用VBA從外部工作簿添加工作表
當我嘗試從外部工作簿中添加一個工作表中我得到一個錯誤:
Method 'Add' of object 'Sheets' failed on the third line`
這裏是我的代碼:
Application.ScreenUpdating = False
Dim ws As Worksheet
Set ws = Worksheets.Add(After:=Sheet1, Count:=2,Type:="\\SharedDrive\Worksheet\Student.xltm")
Application.ScreenUpdating = True
您是否看過它是否適用於本地文件,而不是您在示例中使用的共享? – jon 2012-01-17 19:24:14
這與您最後一個問題幾乎完全相同。 – Reafidy 2012-01-17 20:53:59