Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Suggested answer

Sample code to import data from Excel in ax 2012.getting the following error

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.

Categories:
  • Suggested answer
    Andre Ghazaleh Profile Picture
    Andre Ghazaleh 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
    Sergei Minozhenko 23,083 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
    Gunjan Bhattachayya 35,417 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
    Axbeginerss 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
    Gunjan Bhattachayya 35,417 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
    Axbeginerss 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
    Gunjan Bhattachayya 35,417 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
    Axbeginerss 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
    Gunjan Bhattachayya 35,417 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?

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,989 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,588 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans