Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The following examples show you how to get and set the default path that Microsoft Office Excel uses for loading and saving files.
Applies to: The information in this topic applies to document-level projects and application-level projects for Excel 2007 and Excel 2010. For more information, see Features Available by Office Application and Project Type.
Use the DefaultFilePath property of the _Application object to get the default path.
System.Windows.Forms.MessageBox.Show(Me.Application.DefaultFilePath)
System.Windows.Forms.MessageBox.Show(this.Application.DefaultFilePath);
Assign a string value to the DefaultFilePath property of the Application object.
Me.Application.DefaultFilePath = "C:\temp"
this.Application.DefaultFilePath = @"C:\temp";