How to Automate Excel Spreadsheet Imports in Microsoft Access Forms
Question details
The user wants to trigger an automated Excel spreadsheet import using a form button in Microsoft Access, handle data normalization, and verify if the process works with Access Runtime.

- Product
- Microsoft Access / Microsoft Excel
- Device & OS
- not provided
- Scenario
- Automating repeated data imports from Excel to Access forms and normalizing the imported data into related tables.
- Observed behavior
- The user is looking for the optimal VBA method or linking strategy to handle Excel data imports without encountering execution errors in the Access Runtime environment.
Ensure your source Excel spreadsheet has a clean, consistent structure with proper column headers, and back up your Access database before testing new VBA scripts or append queries.
Use VBA to Automate the Excel Import Process
Utilize VBA code behind a form command button to trigger the import and run append queries for data normalization.
This method involves importing the spreadsheet into a temporary staging table, then using VBA to execute queries that distribute the data into normalized tables.
It is crucial to include robust error handling in your VBA code, especially if the application will be deployed using Access Runtime.
Open your Access form in Design View. Drag a Command Button from the Form Design controls onto your form. Cancel the wizard if it appears, and open the Property Sheet for the button.
In the Event tab of the Property Sheet, click the ellipsis (...) next to 'On Click' and select Code Builder. Use the 'DoCmd.TransferSpreadsheet' method to import the Excel data into a temporary staging table.
Below the import command in your VBA editor, use 'CurrentDb.Execute' to run pre-built append queries that move the data from the temporary staging table into your final, normalized related tables.
Before distributing the database, simulate the Access Runtime environment by renaming your file extension to .accdr or launching it with the /runtime switch to ensure no unhandled VBA errors crash the application.

Link to the Excel Spreadsheet for Repeated Updates
If the source Excel file is updated frequently, linking it as an external table prevents database bloat and simplifies the update process.
Prepare Your Spreadsheets for Import with WPS Office
While Microsoft Access is required for building complex database forms, WPS Spreadsheet is a highly capable, free alternative for preparing, cleaning, and managing your Excel data before importing it into any database.
- 1. Open Your Raw Data: Launch WPS Spreadsheet and open the raw data file you intend to import into your database.
- 2. Clean and Standardize: Use the Data tab tools to remove duplicates, format dates properly, and ensure all columns have consistent data types.
- 3. Save for Access Import: Save the cleaned document in the standard .xlsx format to ensure it links or imports into Microsoft Access without errors.

Frequently Asked Questions
Can I run automated Excel imports safely in Access Runtime?
Yes, but because Access Runtime lacks design views and standard error-handling dialogs, any unhandled VBA error will crash the program. You must include robust error handling (e.g., 'On Error GoTo') in your VBA code and ensure all library references are resolved before deployment.
Why should I link an Excel spreadsheet instead of importing it?
Linking is highly recommended for data that changes frequently. It prevents database bloat by keeping the raw data in Excel, allowing Access to query the most up-to-date information directly without needing a manual import and delete cycle.
How do I handle data normalization during an Excel import?
The best practice is to import the flat Excel data into a temporary 'staging' table in Access first. From there, you can execute a sequence of Append Queries to break apart and distribute the data into your properly normalized, related tables.




