Change the Excel File Path in a Microsoft Access Import Macro
Question details
Change the Excel file path used by an Access import macro.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- An Access database imports an Excel file from a former employee's computer and needs to use a current local or shared network location.
- Observed behavior
- The macro references an Excel file path on the former employee's computer.
Locate the Excel file and copy its full path, including the file name and extension. If others run the macro, confirm that they can access the chosen shared folder.
Edit the Excel file path in Access Macro Design View
Use this method when an Access macro contains the outdated path in its import action.
Access macros are edited in Access, not in the VBA editor. The import action may be named ImportExportSpreadsheet or TransferSpreadsheet, depending on the Access version.
Open the database in Access. In the Navigation Pane, expand the Macros group and find the macro that imports the Excel file.
Right-click the macro and select Design View.
Find the spreadsheet import action and replace the old path in its File Name field with the full path to the Excel file. For a shared folder, use an accessible network path such as \\server\share\folder\file.xlsx.
Save the macro, then run it from the Navigation Pane or its usual button. Confirm that the expected Excel data is imported.

Work with Excel Import Files in WPS Office
WPS Office is a free, lightweight alternative for working with spreadsheet files in a familiar interface. Open and edit Excel-format files in WPS Spreadsheets as you move between Office applications; use Microsoft Access to edit and run the database macro.

Frequently Asked Questions
Should I edit the import macro in the VBA editor?
No. For an Access macro, right-click the macro in the Navigation Pane and select Design View. VBA procedures are edited separately in the VBA editor.
What path should I use if several people run the import?
Use a shared network location that all users can access, such as \\server\share\folder\file.xlsx. Enter the full path in the import action's File Name field.
What if I cannot find the old path in the macro action?
Check whether the File Name field contains an expression or refers to a stored setting. Update the referenced source rather than replacing an unrelated field.
Can WPS Office change or run the Access macro?
Use Microsoft Access to edit and run the macro. WPS Spreadsheets can help you review or edit the Excel file that the macro imports.




