Executing a "Saved Import" or "Saved Export" programmatically (1 Viewer)

ClubSean

New member
Local time
Today, 04:31
Joined
Nov 8, 2023
Messages
6
Microsoft goes to great length to explain how to schedule and execute Saved Imports or Saved Exports in Outlook. This implies there is a way to trigger the Imports or Exports programmatically within Access. Anyone know how to do it within Access without using the Wizard? The intent is to execute a Saved Import with button.

Cheers all.
 
You could try the RunCommand method.
 
Code:
Private Sub cmdExecuteSpec_Click()
    CurrentProject.ImportExportSpecifications("SpecName").Execute
End Sub
 
Code:
'Export
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "Name Query", "D:\AZ.xlsx", True

'Import
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12Xml, "Name Query", "D:\AZ.xlsx", True
 

Users who are viewing this thread

Back
Top Bottom