Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

running excel macro from another workbook

Tags:

excel

vba

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?

like image 361
Alex Gordon Avatar asked May 10 '10 20:05

Alex Gordon


1 Answers

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") 
like image 181
Fink Avatar answered Sep 18 '22 16:09

Fink