Software

Quick tip: Find Excel's XLStart folder fast

We seldom need the XLStart folder, so when we do, we can never remember the entire path. Instead of searching, use this quick Excel tip instead.

The XLStart folder is a special folder created when you install Excel. That's where Excel stores the workbook template, Book.xltx. In addition, if you store a workbook in this folder, Excel will open it automatically every time you launch Excel. The problem is, XLStart can be difficult to find if you don't know where to look and the location isn't always the same from system to system (it depends on your operating system and other installation priorities).

When you need to update the template template or save a workbook to this folder, you probably won't remember the entire path. The quickest way to find its location is to use the Immediate window in the Visual Basic Editor (VBE), as follows:

  1. Press [Alt]+[F11] to launch the VBE.
  2. If the Immediate window isn't visible, press [Ctrl]+g.
  3. In the Immediate window, type ? application.StartupPath and press Enter. VBA will display the path to XLStart.

About

Susan Sales Harkins is an IT consultant, specializing in desktop solutions. Previously, she was editor in chief for The Cobb Group, the world's largest publisher of technical journals.

11 comments
Stampers
Stampers

Thank you so much for this! I was transferring a users profile from one machine to another and the only thing they had missing was the Excel Macros as they didn't transfer across, strangely.


This has sorted it out, and the user is now happy that they don't have to re-write all of their macros.

Bravo!

Marshwiggle
Marshwiggle

Now, wouldn't it be even nicer if Microsoft finally standardized the Office apps so you could just store the template file wherever you wanted to and point to it using the File Locations tab in the Options dialog, as you can in Word? And while they're at it, maybe they could make it as easy to assign macros in Word as it is in Excel ... and maybe even record macros in Access and Outlook, like you can in Excel and Word.

JimDantin
JimDantin

Look at the text closely - the italics font certainly doesn't help! There's a period between 'application' and 'StartupPath" [b]? application.StartupPath[/b]

raymond.mccormick
raymond.mccormick

? application StartUpPath returns "Microsoft Excel" +xlstart opens an empty folder

earlkaplan
earlkaplan

Why not do the simple thing and just hit the windows key and type xlstart?

georgekatkins
georgekatkins

Raymond, The correct syntax is application.StartupPath (note the period after "application"). The reason XLStart would be empty is that you have never created the "Personal" workbook which stores macros you record or write; or you have not put any other workbook into that folder. Personal will be created the first time you record a macro and indicate that you want to store it in Personal (as opposed to the current workbook). Personal is hidden, by default. George

DBlayney
DBlayney

The interesting point here is that typing xlstart in the "search programs and files" box shows the path of what used to be known as the "alternate" startup file (I think it was called this a generation or so ago). This path can also be found in Excel: Options: Advanced - General section (near the end). Displaying Application.StartupPath shows the default path which may not be where you keep templates and your personal.xlsm macro file. I always use an "alternate" folder somewhere in My Documents. This simplifies ensuring that changes get backed up by normal operations. Interesting to see that "?" in the Immediate window appears to do the same as "debug.print"; is this documented anywhere?

ssharkins
ssharkins

That pulls up the log on/off window for me.

raymond.mccormick
raymond.mccormick

Thank you George. Now that it is pointed out I can see the dot - just. However the extra tip xlstar points to a different folder. xlstart gives D:\Program Files\Microsoft Office\Office14\XLSTART (empty) [Programs are installed on D: whenever possible]. Whilst ?application.xlstart gives C:\Users\Ray_Admin\AppData\Roaming\Microsoft\Excel\XLSTART but this folder cannot be found.

georgekatkins
georgekatkins

I failed to note that JimDantin replied to you about the missing period in your syntax. Sorry!