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.

  • Suggested answer
    Andre Ghazaleh Profile Picture
    870 on at
    RE: Sample code to import data from Excel in ax 2012.getting the following error

    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..

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,091 on at
    RE: Sample code to import data from Excel in ax 2012.getting the following error

    Hi Axbeginerss,

    You can take a look at EPPlus library as well

    github.com/.../EPPlus

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

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Sample code to import data from Excel in ax 2012.getting the following error

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

  • Axbeginerss Profile Picture
    25 on at
    RE: Sample code to import data from Excel in ax 2012.getting the following error

    Only excel ...any suggestions.

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Sample code to import data from Excel in ax 2012.getting the following error

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

    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,421 on at
    RE: Sample code to import data from Excel in ax 2012.getting the following error

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

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

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Sample code to import data from Excel in ax 2012.getting the following error

    Hi,

    Are you using SysExcelApplication in a batch process?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,748 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans