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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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,214,911
Messages
6,122,199
Members
449,072
Latest member
DW Draft

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