logo
search
VBA & Macro Problems

Fix Access Import Specification Name Error in VBA

Maira MehtabMaira Mehtab Sep 21, 2026 869 views

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.
Before you start

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.

Solution 1Recommended

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.

1
Open Query Design

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.

2
Switch to SQL View

Click the 'View' button in the top left corner of the ribbon and select 'SQL View' from the dropdown menu.

3
Run the Query

Type the following SQL statement: SELECT SpecName FROM MSysIMEXSpecs; then click the 'Run' button (the red exclamation mark) on the ribbon.

4
Identify the Correct Specification

Review the list of returned names and locate the exact specification name intended for your comma-delimited text file import.

Hidden Objects: Alternatively, you can view this table by right-clicking the Navigation Pane, selecting 'Navigation Options', and checking 'Show System Objects'.
Free Microsoft Office alternative

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. 1. Download WPS Office: Download and install the free WPS Office suite from the official website.
  2. 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. 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.
Free and lightweight office suite for daily productivityHighly compatible with Microsoft Excel (.xlsx), Word (.docx), and PowerPoint (.pptx) formatsEasily import and manage CSV and text files without writing VBA codeFamiliar user interface for quick adaptation and seamless migration
microsoft office alternative - wps office

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.