Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default Template - EXCEL 2000 GregNga Excel Discussion (Misc queries) 0 November 25th 08 07:37 PM
default template Excel uses at start-up Mel New Users to Excel 3 November 1st 07 05:06 PM
Need Help with Default Template in Excel T.C. Mann Excel Discussion (Misc queries) 2 May 2nd 07 07:37 PM
Help with Default Excel file and template Mark McDonough Excel Discussion (Misc queries) 2 May 26th 06 02:50 AM
Excel template to load automatically as the default template? David Excel Discussion (Misc queries) 1 March 21st 05 12:24 PM


All times are GMT +1. The time now is 08:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"