Running Macro in Newly Saved file

Dannyh1

Well-known Member
Joined
Nov 18, 2009
Messages
1,144
Hi,

I currently have a sheet where I trigger to run a macro in another workbook at a specific time. This currently works OK.

I need the same code to run with a slight variation.

I tried to Save As the workbook from where the code is ran:

From:

GETMIXERINFO.xls

To

GETMIXERINFO 2MNTHS.xls

I kept the names of the macro's the same, but when I come to trigger the code in GETMIXERINFO 2MNTHS.xls, it says:

The macro 'GETMIXERINFO 2MNTHS.xls!Run1st' cannot be found.

I can see the macro Run1st is definatley in the workbook GETMIXERINFO 2MNTHS.xls.

Advice appreciated!

Thanks.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
You should prefix and suffix ' (apostrophe) with the filename..

Code:
Application.Run ("'" & FileName & "'!MacroName1")
 
Upvote 0

Forum statistics

Threads
1,203,515
Messages
6,055,844
Members
444,828
Latest member
StaffordStag

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