Fix Access Import Specification Name Error in VBA
Question details
A user encounters an error in VBA stating that the named import specification cannot be found when attempting to automate a text file import.
- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Automating the import of a comma-delimited text file using the DoCmd.TransferText VBA method.
- Observed behavior
- The manual import works successfully, but the VBA execution fails because the specified import specification name (e.g., ImportEvents) does not match the actual saved specification name.
Verify the exact file path of the comma-delimited text file you are trying to import, and ensure you have sufficient permissions to read the file.
Query the MSysIMEXSpecs System Table to Find the Name
Find the exact names of all saved import specifications by querying the hidden Access system table.
Microsoft Access stores saved import and export specifications in a hidden system table called MSysIMEXSpecs. By querying this table directly, you can bypass the wizard and find the exact string Access expects in your VBA code.
Open your Access database, navigate to the 'Create' tab on the ribbon, and click on 'Query Design'. Close the 'Show Table' dialog without adding any tables.
Click the 'View' button in the top left corner of the ribbon and select 'SQL View' from the dropdown menu.
Type the following SQL statement: SELECT SpecName FROM MSysIMEXSpecs; then click the 'Run' button (the red exclamation mark) on the ribbon.
Review the list of returned names and locate the exact specification name intended for your comma-delimited text file import.
Update the DoCmd.TransferText VBA Statement
Replace the incorrect specification name in your VBA code with the actual name retrieved from the system table.
Manage Data Easily with WPS Office
While WPS Office does not include a direct Microsoft Access alternative, you can manage extensive datasets effortlessly with WPS Spreadsheet. It offers a free, lightweight, and highly compatible suite for your daily document, spreadsheet, and presentation needs without relying on complex VBA for basic data imports.
- 1. Download WPS Office: Download and install the free WPS Office suite from the official website.
- 2. Import Text Data Directly: Open WPS Spreadsheet, navigate to the 'Data' tab, and use the 'Import Data' feature to easily load CSV or delimited text files.
- 3. Analyze Without Code: Use built-in filtering, sorting, and pivot table tools to analyze your datasets instantly, bypassing the need for complex database macros.

Frequently Asked Questions
Why does DoCmd.TransferText work manually but fail in VBA?
Manual imports often rely on default settings or implicitly temporary specifications created by the import wizard. In VBA, DoCmd.TransferText requires the exact, case-sensitive name of a permanently saved import specification; otherwise, Access cannot locate the parsing rules.
How do I save an import specification in Access?
When you manually import a text file using the 'Get External Data' wizard, click the 'Advanced' button in the bottom left corner. Configure your delimiter and field settings, then click 'Save As' to assign a name and save the specification for future VBA use.
What parameters does DoCmd.TransferText require for a comma-delimited file?
To import a comma-delimited file, you typically need the TransferType (acImportDelim), the SpecificationName (the exact saved spec name), the TableName (target table), and the FileName (full path to the text file). An optional parameter indicates if the file has field names.




