使用宏执行xls无法错误1004

时间:2009-09-23 05:40:08

标签: vba excel-vba excel

文件存在,打开工作簿但是Application.run给出了1004

Set wbtarget = Workbooks.Open(mypath + "\launcher.xls")
Application.Run (wbtarget.Name & "!StartMerge")

1 个答案:

答案 0 :(得分:0)

如果StartMerge宏在模块中,您的代码应该可以工作,但我怀疑它在工作表代码中。如果是这种情况,请尝试添加宏所在的表单名称,例如

Application.Run (wbtarget.Name & "!Sheet1.StartMerge")
相关问题