title: Better way to run DoCmd.RunSavedImportExport
body: <p>Current situation is I have my machine (C:) starting script/macro "Start" which opens up access db on shared drive (Q:\Database.accdb) and runs numerous specifications to update table (<code>DoCmd.RunSavedImportExport</code>) and runs numerous specifications from frontend (Q:\Dashboard.accdb) to produce "reports" (<code>DoCmd.RunSavedImportExport</code>). I can't seem to get both to execute 100% of time without various errors popping up. </p>
  
  <p>Currently I have managed to get the first set of <code>DoCmd.RunSavedImportExport</code>s to run properly but I keep getting the following error when I attempt to launch the next set:</p>
  
  <p>Run time error '462'</p>
  
  <p>The remote server machine does not exist or is unavailable. </p>
  
  <p>I want to say the issue is I am getting some sort of lock but I am opening a whole new file? Any help?</p>
  
  <pre><code>Public Function Start()
  
  Dim appAccess As Access.Application
  Set appAccess = CreateObject("Access.Application")
  appAccess.OpenCurrentDatabase "Q:\Database.accdb"
  appAccess.Application.Visible = True
  
  DoCmd.RunSavedImportExport "CoolUploadToDB1"
  DoCmd.RunSavedImportExport "CoolUploadToDB2"
  
  KillProcess "MSACCESS.exe"
  ExportReports
  
  End Function
  
  Public Function ExportReports()
  
  Dim appAccess As Access.Application
  Set appAccess = CreateObject("Access.Application")
  appAccess.OpenCurrentDatabase "Q:\Dashboard.accdb"
  appAccess.Application.Visible = True
  Application.Wait (Now + TimeValue("0:00:05"))
  
  #Consistently works up until here:
  #Gives error: Run time error '462': The remote server machine does not exist or is unavailable.
  
  DoCmd.RunSavedImportExport "ExportCoolReport1"
  CoolFuncToAnnoySomePeopleWithReport "OneGuyITotallyHate@coolcompany.com"
  
  appAccess.CloseCurrentDatabase
  appAccess.Application.Quit
  Set appAccess = Nothing
  Application.DisplayAlerts = True
  
  End Function
  </code></pre>