Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Heidi
 
Posts: n/a
Default Auto-displaying a template when Excel is launched

I would like a template to auto-display when Excel is launched. I placed the
..xlt in the XLSTART folder and modified Excel Options in OptionsGeneral"At
startup, open all files in" option to point to the location of the .xlt.

The .xlt is failing to auto-load when Excel is launched. I am following the
exact instructions of MS Help. Aurgh!!!
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

I don't read the help that way.

I read it to say that if you have a template named book.xlt stored in XLStart,
it'll use that as the basis for any new workbook--and that any workbook (.xls)
that's in that folder will be opened when xl starts.

And the "at startup, open all files in" I read to say that any workbook that's
in that folder will be opened when xl starts. But it also can be used to as the
template location for File|new.

From the help from xl2003:

Storing default workbook and worksheet templates
If you've created a template named Book.xlt or Sheet.xlt and saved it in the
XLStart folder, Microsoft Excel uses the template to create new default
workbooks (default startup workbook: The new, unsaved workbook that's displayed
when you start Excel. The default startup workbook is displayed only if you
haven't included other workbooks in the XLStart folder.) or to insert new
worksheets. The XLStart folder is usually located at:

C:\Program Files\Microsoft Office\Office11\XLStart

To use template (.xlt) files stored on a network file location, you can specify
that location as the alternate startup folder (alternate startup folder: A
folder in addition to the XLStart folder that contains workbooks or other files
that you want to be opened automatically when you start Excel and templates that
you want to be available when you create new workbooks.).

====
But I don't think it's that important what the help says! (It's been wrong
before.) But you've seen how excel treats templates in those folders. (The
proof of the pudding is in the eating!)

How about an alternative?

First, clean up that "at startup, ..." box (empty that box in the dialog).

Then start a new workbook and put this into a General module in that workbook:

Option Explicit
Sub auto_open()

Dim myTemplateName As String
Dim testStr As String

myTemplateName = "C:\my documents\excel\book1.xlt"

testStr = ""
On Error Resume Next
testStr = Dir(myTemplateName)
On Error GoTo 0

If testStr = "" Then
'not found
MsgBox myTemplateName & " wasn't found"
Beep
Else
Workbooks.Add template:=myTemplateName
End If

ThisWorkbook.Close savechanges:=False

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Short course:

Open your workbook.
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel and save it into your XLStart folder. Then close and
reopen excel.

(Ps. change the name of the template.)


Heidi wrote:

I would like a template to auto-display when Excel is launched. I placed the
.xlt in the XLSTART folder and modified Excel Options in OptionsGeneral"At
startup, open all files in" option to point to the location of the .xlt.

The .xlt is failing to auto-load when Excel is launched. I am following the
exact instructions of MS Help. Aurgh!!!


--

Dave Peterson
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
WANTED: Excel template for loan payment record with random/irregular payments cassidy Excel Discussion (Misc queries) 1 July 24th 05 01:09 AM
Template Wizard w/Data Tracking in Excel 2003 Pro? NWBM Excel Discussion (Misc queries) 2 July 2nd 05 01:45 AM
Template in Excel prettytwin1 New Users to Excel 1 March 9th 05 09:22 PM
Email template from excel rlbriley Excel Discussion (Misc queries) 1 March 9th 05 10:16 AM
excel links update not working in auto, calculations in auto Mikey Boy Excel Worksheet Functions 0 December 7th 04 11:53 PM


All times are GMT +1. The time now is 12:40 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"