17 Apr’17

Dynamics NAVImporting Excel file in Microsoft Dynamics NAV using Excel Buffer


This article is to import data from the Excel file into existing NAV table. This import matches the excel entries with the existing NAV table and modifies the records of the table on import of the excel file. To accomplish this, we create a report using Excel Buffer as the DataItem.


  1. Microsoft Dynamics NAV 2017
  2. Microsoft Excel.


1. Create a table with fields and populate it with data.

2. Create a excel file which you want to import.

3. A page is created with action button to Import data from excel.

4. A Report is created using Excel Buffer(table id 370) as a Data Item. The report property Processing Only is set to yes. Standard ‘ReadSheet’ function of the table Excel buffer is used to read the data from the Excel file.

5. A function is used to calculate the total number of rows and columns using Excel Buffer table.

6. On the PreReport function of the report we write the following code.

7. In the Insert Data function it initializes the table created in step 1,  sets the range from the matching fields and if found it inserts values in the table.

8. To open the Excel file and selection of sheet we write a code in the Request Page in  the Report. We use File Management codeunit to upload file.

9. Now run the page and click on the action Import then select the excel file.

10. The import is completed and we can view the modified changes on the page after the excel file import.

Written by

Chris D'Silva

Software Developer

One thought on “Importing Excel file in Microsoft Dynamics NAV using Excel Buffer”

  1. Hello Chris D’Silva,

    thank you for this helpful article.
    In Step 8 you used the UploadFile Function, I don’t understand the second Parameter in this Function, where does it come from and what is it’s usage?


    Timo Beermann

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Dynamics 365 Client Diagnostics

    15 March’ 2018

    Main cause of Performance Issues: Bandwidth and latency are the primary characteristics which affects the performance o...

    Read more
  • Closing Blind Shift in MPOS and CPOS in Dynamics 365 for Retail

    15 March’ 2018

    Manual For closing Blind shift in POS: Blind shifts terminate the currently ongoing shift and when logged in a new shif...

    Read more
  • Persistent Filters in the Power BI Service

    13 March’ 2018

    Introduction: The feature is finally release, and it is power BI has announced general availability of persistent filt...

    Read more
  • Cause and Solution for Scribe MSMQ not receiving Message from AX

    10 March’ 2018

    Issue: Microsoft Message Queuing (MSMQ) service running on Server might be unable to receive messages. Therefore, messa...

    Read more
  • User Privileges on SharePoint – D365 Document Integration

    10 March’ 2018

    Overview: Often, we wonder what could be wrong where we see a generic error on Documents in Dynamics 365. Something lik...

    Read more