从另一个工作簿运行excel宏 [英] running excel macro from another workbook
问题描述
目前我在做:
Application.Run(L:\database\lcmsmacro\macro1.xlsm!macro_name)
我收到的错误消息是该工作簿#1004中可能无法使用该宏
我已经确保我的安全设置设置在最低级别。
如何从托管在其他服务器上的另一个工作簿运行宏?
将使用加载项帮助我?
我觉得你的语法缺少单引号:
Application.Run('L:\database\lcmsmacro\macro1.xlsm'!macro_name )
然后,如果需要传递参数,语法将如下所示: p>
Application.Run('L:\datab ase \lcmsmacro\macro1.xlsm'!macro_name,param1,param2)
I have a macro that is on a server. I need to be able to run it from different workstations that connect to this server.
Currently I am doing:
Application.Run ("L:\database\lcmsmacro\macro1.xlsm!macro_name")
The error message I am getting is "The macro may not be available in this workbook #1004"
I have already made sure that my security settings are set on the lowest level.
How do I run a macro from another workbook which is hosted on a different server?
would using add-ins help me?
I think your syntax is missing the single quote characters:
Application.Run ("'L:\database\lcmsmacro\macro1.xlsm'!macro_name")
Then, if you needed to pass parameters to it the syntax would be like this:
Application.Run ("'L:\database\lcmsmacro\macro1.xlsm'!macro_name","param1","param2")
这篇关于从另一个工作簿运行excel宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!