Depending on the type of data you're working with, you can automate importing, exporting, and linking of data by carrying out the TransferDatabase, TransferSpreadsheet, or TransferText action in a macro or Visual Basic procedure.
Automate importing, exporting, or linking of data by using a macro
Automate importing, exporting, or linking of data by using Visual Basic for Applications