web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Sample code for reading excel workbook from a path into ax table via batch jobs

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

Can anyone help  me with sample code which would read entire excel workbook (as it is all sheets in workbook i cannot use dixif) from a particular network drive path  on periodic basis & populate data into ax table.

I think SysExcel class wont work as that will work at client level only.

Thank

Mav

I have the same question (0)
  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    You can use ExcelPackage class from OfficeOpenXml namespace. You can find plenty of examples on the internet; some of them are even for AX 2012.

    I think you could also process the file with DIXF, just not at once, but a single worksheet at a time.

  • Mav Profile Picture
    on at

    My 1st preference is DIxif   & hence wanted to check if  you can pls elaborate on

    "I think you could also process the file with DIXF, just not at once, but a single worksheet at a time."

    Scenario

    1 excel workfbook - multiple sheets all of this data to go into 1 single custom entity in Ax2012 via batch job i.e. minimum user intervention.

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    If you know how to import a single worksheet (and how you select which one), what is preventing your from importing multiple worksheets one by one?

    Yes another approach would be transforming the file before importing.

  • Mav Profile Picture
    on at

    So what is stopping me is the error that entity A is already used which i get when adding entity A again in 2nd line  for sheet 2.

    How can i overcome this in processing group form.

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Then you would need multiple projects.

    I personally wouldn't do it, though. Having an extra step transforming the file to something that you can easily import sounds much easier to me.

  • Mav Profile Picture
    on at

    This is in Ax2012 can you share some sample code or reference where I can address below scenario.

    read excel workbook (all sheets) periodically from a folder

    enter that data into ax table

  • Suggested answer
    Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Don't try to solve all problem at once. Let's focus on reading the file for now and if you don't know how to work with AX tables, let's address that later.

    Does it mean that you rejected both transforming the file and using ExcelPackage to import the file? Then you can surely find some other libraries, but you should explain why you rejected this one, so we can suggest something more suitable for you.

    Or does it mean that you don't know how to use ExcelPackage and you simply gave up? Do you have any particular problem? Did you look at examples on the internet?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 584 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 499 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 254 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans