I would do as Sam said. Skip the code if lcase(ThisWorkbook.Name)<>lcase("whateveryoucallthetemplate.xlsm"). This will always work as Excel can never have two workbooks with the same name open at once.