stuartgb100
06-30-2015, 07:35 AM
I'm trying to tell whether user has just opened a template file or a macro-enabled workbook.
If I use activeworkbook.fullname:
for the .xlsm I would get: test file.xlsm
but the template just gives: test file template1
So the template does not give the file extension (.xltm) and the template file has been renamed template1.
I assume this is because template1 is a newly-created file and therefore has not been saved.
So what would be the best way to test which file has been opened ?
Perhaps something like:
If the active book has the file extension ".xlsm" then exit
but
If the active book contains the string "template1" in the workbook name
Then do something else
Many thanks.
If I use activeworkbook.fullname:
for the .xlsm I would get: test file.xlsm
but the template just gives: test file template1
So the template does not give the file extension (.xltm) and the template file has been renamed template1.
I assume this is because template1 is a newly-created file and therefore has not been saved.
So what would be the best way to test which file has been opened ?
Perhaps something like:
If the active book has the file extension ".xlsm" then exit
but
If the active book contains the string "template1" in the workbook name
Then do something else
Many thanks.