Excel VBA: Getting the XLStart folder path

This Excel VBA macro shows a message box with the XLStart folder path.

Macro Example

Sub GetXLStartPath()

 MsgBox Application.StartupPath

End Sub

Description

Application

  Application...

The Application property returns the Application object.

obj-Excel-Global-Application

Application.StartupPath

  Application.StartupPath

The Application.StartupPath property returns the complete path of the startup folder.

obj-Excel-Application-StartupPath

The code: Application.StartupPath is set to the parameter of a MsgBox function.
So, a message box displays the full path to the Microsoft Excel startup folder.

Sub GetXLStartPath()

 MsgBox Application.StartupPath

End Sub

Properties

http://www.relief.jp/itnote/archives/003893.php

Apply to

  • Excel 2013
  • Excel 2010
  • Excel 2007