Data Import & Export

How to Fix Extra Spaces When Copying from Excel to Dynamics NAV

Jason MillerJason Miller Nov 3, 2026 869 views

Question details

Users experience an issue where copying numbers or item codes from Excel into Dynamics NAV introduces leading blank spaces, causing data recognition failures in the system.

Fix Extra Spaces When Copying Data from Excel to Dynamics NAV
Product
Microsoft Excel and Dynamics NAV
Device & OS
not provided
Scenario
Copying and pasting item codes, numbers, or standard data from an Excel spreadsheet into Dynamics NAV fields.
Observed behavior
When pasting the copied Excel data directly into NAV, two or three automatic leading spaces are added, making the values unrecognizable by the system.
Before you start

Before proceeding with the clipboard workarounds, use the Excel TRIM function or double-click your cells to verify that the extra spaces are not actually embedded in your original spreadsheet data.

Solution 1Recommended

Use Microsoft Word or Notepad as a Clipboard Intermediary

By pasting the data into an intermediary application first, you can strip away the complex Excel metadata that Dynamics NAV misinterprets.

When you select cells in Excel and copy them, the clipboard stores multiple layers of rich text, HTML, and XML formatting. Dynamics NAV takes data directly from the clipboard and often misinterprets this extra formatting as blank spaces.

1
Copy data from Excel

Select the item codes or numbers in your Excel spreadsheet and press Ctrl+C to copy them to your clipboard.

2
Paste into an intermediary app

Open a blank document in Microsoft Word or a plain text editor like Notepad, and press Ctrl+V to paste the copied data.

3
Copy and paste into Dynamics NAV

Select the newly pasted data in Word or Notepad, press Ctrl+C to copy it again, and then paste it directly into the target field in Dynamics NAV.

Use Microsoft Word or Notepad as a Clipboard Intermediary
Why this works: Word and Notepad restructure the clipboard data into a simpler text format, dropping the conflicting Excel tags that cause NAV to generate automatic spaces.
Free Microsoft Office alternative

Try WPS Office for Cleaner Data Management

If you frequently encounter frustrating clipboard formatting issues or heavy metadata problems in Microsoft Excel, consider switching to WPS Office. It provides a lightweight, clean, and highly compatible spreadsheet experience.

  1. 1. Download WPS Office: Visit the official WPS website to download and install the free WPS Office suite.
  2. 2. Open your files: Open your existing Excel workbooks directly in WPS Spreadsheet without losing any data.
  3. 3. Manage data smoothly: Copy and export your data cleanly to external systems and databases.
Highly compatible with Microsoft Excel (.xlsx, .xls, .csv) formatsLightweight architecture for faster copying, pasting, and data handlingClean clipboard output that integrates smoothly with third-party softwareFamiliar user interface requiring zero learning curve
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel add spaces when I copy and paste data?

Excel itself does not add the spaces. When you copy a cell, Excel sends a complex mix of data formats (including HTML and XML) to your system's clipboard. The receiving application (like Dynamics NAV) might misread this background formatting, mistakenly rendering it as extra leading spaces.

Can I use the Excel CODE or TRIM functions to fix this issue?

No. Functions like TRIM remove spaces that are physically present inside the Excel cell. Because the spaces in this scenario are generated dynamically by Dynamics NAV during the paste action, checking or altering the cell contents within Excel will not resolve the issue.

Are there other ways to import Excel data into Dynamics NAV without copying and pasting?

Yes. Instead of manual copy-pasting, you can save your Excel spreadsheet as a CSV (Comma Separated Values) file. You can then use Dynamics NAV's built-in data migration tools, such as RapidStart Services, to bulk import item codes accurately without triggering clipboard errors.