Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

Import from excel file using X++

Posted on by 3,803

Hi all..

I have excel file with field and records like Invoice Journal.

I want import from excel file into Invoice Journal using X++.

Can you help me?

Thanks all..

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Import from excel file using X++

    Hi,

    Please refer below link for Excel AddIns process

    ax2012exceldataimport.blogspot.in/.../dynamics-ax-2012-excel-add-in-vendor.html

    Thanks & Regards:

    Edwin.X

  • Verified answer
    Brandon Wiese Profile Picture
    Brandon Wiese 17,786 on at
    RE: Import from excel file using X++

    Like Tommy indicated, talking to Excel over COM from within X++ is extremely slow.  We do quite a lot of importing from Excel, and for MANY reasons (not just performance), we either use XML Spreadsheet 2003 documents (which users can still open and edit with Excel directly), or when forced to use XLS files they can be read as XML files with some light code changes to SysExcelCells object, adding a value() method..

    public str value(str _value = '')  // returns XML Spreadsheet 2003

    {

       COMVariant  ret;

       ;

       if (!prmisdefault(_value))

       {

           ret = cells.value(#xlRangeValueXMLSpreadsheet,_value);

       }

       else

       {

           ret = cells.value(#xlRangeValueXMLSpreadsheet);

       }

       return ret.bStr();

    }

    This lets you return an entire worksheet from a workbook as an XML Spreadsheet 2003 XMLDocument, which is easy and fast to read in X++ directly, even on the server tier.  

    Hope this helps.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Import from excel file using X++

    Hi,

    Instead of writing code to import from Excel, you can use Excel Add-ins to do this.

    please refer the following topic on how to use excel add-ins

    http://technet.microsoft.com/en-us/library/hh781099.aspx 

  • Verified answer
    skaue Profile Picture
    skaue on at
    RE: Import from excel file using X++

    While it is possible, you should benchmark the performance of your import. In my experience, sitting "outside" of Excel and reading data from a spreadsheet does not perform very well. So if your spreadsheets contain thousands of rows, you may consider using text files instead, exported from Excel of course. It might very well be this is now performing a lot better since the last time I tried connecting a spreadsheet from X++.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Import from excel file using X++

    see if this link can help you out?

    community.dynamics.com/.../import-ledger-ap-and-ar-invoice-journal-lines.aspx

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,339 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,177 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans