You can put an "if endif" round the main code to detect whether the activeworkbook has a template extension:
[VBA]Dim btxt, atxt, txtnm As String
txtnm = ActiveWorkbook.Name
atxt = Right(txtnm, 4)
btxt = Left(atxt, 3)
If btxt <> "xlt" Then
' all the other code
End If
[/vba]