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 to import data from Excel in ax 2012.getting the following error

(0) ShareShare
ReportReport
Posted on by 25

"Stack trace: Invalid attempt to call SysExcelApplication.construct running in CIL on the client."

if we can use sysexcel then what is the option any reference.

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi,

    Are you using SysExcelApplication in a batch process?

  • Axbeginerss Profile Picture
    25 on at

    yes...thats the place i am getting the error.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    I don't think you can run SysExcelApplication in batch class. It only works on client.

    Can you not use DIXF for importing excel files?

  • Axbeginerss Profile Picture
    25 on at

    As per the client requirement ..i cant use DIXF so..do u have another option that can help to import data from batchjob any reference??

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    I think importing using CSV files will be the easiest to implement. Will that be an acceptable solution or do you clients want to import excel files only?

  • Axbeginerss Profile Picture
    25 on at

    Only excel ...any suggestions.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Have you already tried something like what is mentioned in this link?

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi Axbeginerss,

    You can take a look at EPPlus library as well

    github.com/.../EPPlus

    stackoverflow.com/.../epplus-read-excel-table

  • Suggested answer
    Andre Ghazaleh Profile Picture
    870 on at

    You can't use SysExcelApplication from a batch job that executes on the server. If you cannot use the DIXF, remember that you are not bound to X++ , why not use C#.net and then consume the .net assembly in AX? If you want to follow this approach, it's explained in this Link 

    And if don't want to use C#.net use the CommaTextIo class to import csv file (you have to convert the excel file to csv) 

    Best regards..

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 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans