从另一个工作簿运行excel宏 [英] running excel macro from another workbook

查看:296
本文介绍了从另一个工作簿运行excel宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个服务器上的宏。我需要能够从连接到此服务器的不同工作站运行。



目前我在做:

  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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆