如何使用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