Default SaveAs Filepath

mharper90

Board Regular
Joined
May 28, 2013
Messages
117
Office Version
  1. 365
Platform
  1. MacOS
Below is a portion of a macro that saves the current workbook, prompts the user to SaveAs, and then (not shown) it clears the workbook to start a fresh period/quarter.

On our LAN, when it prompts to SaveAs, it defaults to My Computer, is which is a terrible navigation to get to the right network drive folder. The original file that was just saved prior to the SaveAs, was in the right spot, so is there a way to get the SaveAs to start in the same folder, or maybe 1 folder level up from where the original file already is?

Code:
Dim msgValue

ActiveWorkbook.Save
msgValue = MsgBox("Select file location for new TLD Period on next window.", vbOKOnly, "New TLD Period")
fName = Application.GetSaveAsFilename( _[INDENT]InitialFileName:="TLD " & Me.TextBox1.Text & " P" & Me.TextBox2.Text, FileFilter:="(*.xlsm), *xlsm", Title:="Save New TLD Period")[/INDENT]
If fName <> False Then
[INDENT]ActiveWorkbook.SaveAs Filename:=fName[/INDENT]
Else
End If
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
How about
Code:
Fname = Application.GetSaveAsFilename( _
InitialFileName:=ActiveWorkbook.Path & "\TLD " & Me.TextBox1.Text & " P" & Me.TextBox2.Text, FileFilter:="(*.xlsm), *xlsm", Title:="Save New TLD Period")
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top