Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Default excel Template
Hi,
Can a macro be set to the default excel template so that when ever a user opens a new spreadsheet the macro is executed? where can the default excel template located? thanks, Shiv .. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Default excel Template
Shiv,
There is no way to truly create a Default template for Excel like you can with Word. However, if you have a desire to run a specific set of code with each file being opened you can capture the Workbook Open event in your own class module of the personal.xls. Create a Module in Personal.xls and add the following code: Dim AppObject as New Class1 Sub Auto_Open Set AppObject.AppEvent = Application End Sub Create a New Class Module in Personal.xls and add the following code. Public WB as Workbook Public WithEvents AppEvent as Application Private Sub AppEvent_WorkbookOpen(ByVal WB as Excel.Workbook) 'Enter the code you want to run each time a workbook is opened Debug.Print WB.Name End Sub Now if you are just looking for something that will look like the default template such as Book1. You can create your own book.xlt and put it in the XLStart folder and each time Excel is launched it will open this book up. If you have a Open event or Auto_Open in this template it will run each time the workbook is opened, even after saving it to the new name. -- Chris Nicholas, MCSE "A man may fail many times, but he isn't a failure until he begins to blame someone else." --Knox Manning "shivakumar" wrote in message ... Hi, Can a macro be set to the default excel template so that when ever a user opens a new spreadsheet the macro is executed? where can the default excel template located? thanks, Shiv . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Default Template - EXCEL 2000 | Excel Discussion (Misc queries) | |||
default template Excel uses at start-up | New Users to Excel | |||
Need Help with Default Template in Excel | Excel Discussion (Misc queries) | |||
Help with Default Excel file and template | Excel Discussion (Misc queries) | |||
Excel template to load automatically as the default template? | Excel Discussion (Misc queries) |