title: VBA Saving to CurDir on Mapped Drive
body: <p>I created a macro that needs some tweaking but cannot find an answer to one part. Based on the user input of officename, it opens up the SaveAs dialog box and creates a folder in the current directory of the file + today's date. When saved locally this works fine. When the file is moved to the mapped drive the save as dialog box opens to my local downloads folder. I've tried a few things but all have the same result.</p>
  
  <p>When I debug and print the path it is correct. I believe the problem lies somewhere with how I'm using the FileSystemObject and the ChDir even though from what I've read these should be working fine the way they're being used. The complete sub is pasted below.</p>
  
  <pre><code>Sub SaveAs()
  Dim file_name As Variant
  Dim xdir As String
  Dim fso
  Dim saveDate As String
  
  Set fso = CreateObject("Scripting.FileSystemObject")
  saveDate = Date
  saveDate = Replace(saveDate, "/", ".")
  'Debug.Print "Test" &amp; " "; officeName &lt;-- good
  Fname = officename &amp; " " &amp; Date
  Fname = Replace(Fname, "/", "-")
  Debug.Print Fname &lt;-- good
  xdir = ThisWorkbook.Path &amp; "\" &amp; officename
  Debug.Print xdir &lt;-- good
  If Not fso.FolderExists(xdir) Then
   fso.CreateFolder (xdir)
  End If
  
  ChDir (xdir)
  
  ' Get the file name.
  file_name = Application.GetSaveAsFilename(Fname, _
      FileFilter:="Excel Macro-Enabled Workbook,*.xlsm,All Files,*.*", _
      Title:="Save As File Name")
  
  ' See if the user canceled.
  If file_name = False Or "False.xls" Then Exit Sub
  </code></pre>