Prob'ly oughta post the solution I found:
The code in the template saves it as *.xls. Problem is, XL didn't recognize
it as a regular workbook, still as a template. Had to add this to the SaveAs:
ThisWorkbook.SaveAs _
Filename:=fname _
password:="xxxxxx" _
FileFormat:=xlWorkbookNormal
The last parameter is what makes XL recognize it as a "normal" workbook.
Then, at the top of the code, I added this line:
If ThisWorkbook.FileFormat <> xlTemplate Then Exit Sub
Voila! The code won't be executed if it's not a template!
I'm outtahere!
--
Adios,
Clay Harryman
"Clayman" wrote:
> I have code that needs only execute when a template is opened. The code saves
> the template as .xls, and in that state the code should not execute. I
> thought about deleting the code when the template is saved as a sheet,
> --
> Adios,
> Clay Harryman
|