Active Workbook Name To Call a Macro

alexaronson

Active Member
Joined
Sep 30, 2005
Messages
314
Hello and thank you for your help

I have the following code that calls a macro for me.

Code:
Application.Run "Test.xlsm'!NamShortList"

One of the problems I am runnign into is that my users are changing the file name. So I thought about changing the file name to a variable with the following code
Code:
Dim WbName As Variant
WbName = ActiveWorkbook.Name
I am trying to replace the Test.xlsm piece of the original code with WbName. However I can't seem to get the macro to fire off.

Any suggestions?
Thanks
 
What if the problem is in one of the subs that could get called?

It might not even be an error.
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top