I have used templates more in Word than in Excel, but I think it is the same idea: You normally don't open a template, to save it with a different name; instead, you directly create a new file,
based on the template. I think that would be with the .Add() method.
Now, this is for the end-user, to avoid accidentally overwriting the template with the modified version. For programmatic control, your code should work just as well. But .Add() might be simpler (one line for creating the document, one for saving it, instead of your 4 lines of code) - if it works.
>Thanks Hilmar. I actually got it, now. In case somebody might want to see the code, here's how I did it.
>
>excel = createobject('Excel.Application')
>excel.Workbooks.Open('mytemplate.xlt')
>excel.ActiveWorkbook.SaveAs('newexcelfile.xls')
>excel.ActiveWorkbook.Close()
>excel.Workbooks.Open('newexcelfile.xls)
>
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)