Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
open workbook b when workbook a opened | Excel Discussion (Misc queries) | |||
Unhide Row when workbook is opened | Excel Discussion (Misc queries) | |||
How to run a macro as soon a a workbook (.xls) is opened? | Excel Worksheet Functions | |||
Workbook copies itself when opened | Excel Worksheet Functions | |||
Setting up a fiile/template to generate a new number when opened? | Excel Worksheet Functions |