Macros do not work when file name is changed

mthomas57

New Member
Joined
Jan 4, 2019
Messages
17
Hello all this is Mike

I want to use a "template" file named CALC_Letter_Matrix_TEMP.xlsm. The macros work fine is this file. An MS Access database is using this template file and changes the name to a permanent file name with a date stamp in the file name. When I open the saved file the macros do not work. The "Template" file has the macros set to "All Open Workbooks". Am I missing something?

Also users use the saved file and are on a shared network.

Below is my references to the workbook so nothing is hard-coded to a specific file name.

Thanks so much for your help.


Code:
WSName = ActiveSheet.Name
Set ws = ThisWorkbook.Worksheets(WSName)

'Path to same file
FilePath = Application.ActiveWorkbook.FullName
 
Last edited:

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Not sure why but it's working now. If anyone has an idea why it might have not worked at first please feel free to enlighten me. Thanks again so much!
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

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