Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Determine if a workbook is already open | Excel Programming | |||
Template track phone traffic to determine weekly, monthly trends. | New Users to Excel | |||
How do I determine how many pages my excel workbook is? | Excel Discussion (Misc queries) | |||
How can I determine who has workbook open? | Excel Programming | |||
Determine if a workbook is shared | Excel Programming |