It can be done but what if you open the Template more than once per day?
This code placed in Thisworkbook module of MyBook.xlt will immediately save
the copy as mybookmm-dd-yyyy.xls but if a copy with that name already exists
what do you want to do?
Private Sub Workbook_Open()
If ActiveWorkbook.Path <> "" Then Exit Sub
'allows you to open a saved copy without renaming
'names and saves newly opened copy
ActiveWorkbook.SaveAs Filename:= _
"C:\Program Files\Microsoft Office\Exceldata\mybook" & _
Format(Date, "mm-dd-yyyy") & ".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False _
, CreateBackup:=False
End Sub
Gord Dibben MS Excel MVP
On Wed, 25 Nov 2009 07:54:16 -0800, SC in Texas
<(E-Mail Removed)> wrote:
>How can I control the name of a new workbook opened from template?
>Such as using MyWorkbook.xlt to open MyWorkBookToday.xls instead of
>MyWorkbook1.xls.
>
>Thanks,
>Steve
|