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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Import label language from excel file to ax

(0) ShareShare
ReportReport
Posted on by 6,648

Hi Guys,

I want to add some label to (for example 'en-us') . now some label are in a file excel as below.

What is x++ code exactly to do this?

0724.csv.png

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Jie G Profile Picture
    Microsoft Employee on at

    Hi Hossein,

    First you need to read excel file through X++ code, please refer: community.dynamics.com/.../how-to-read-write-an-excel-file-through-x-code

    You can use the SysLabelEdit.labelInsert to create new lables, please refer: community.dynamics.com/.../insert-label-by-code-in-axapta-in-any-language

  • Hossein.K Profile Picture
    6,648 on at

    Thanks Ada Ding,

    It work correctly.

  • Verified answer
    Hossein.K Profile Picture
    6,648 on at

    static void ImportExcel(Args _args) { SysExcelApplication application; SysExcelWorkbooks workbooks; SysExcelWorkbook workbook; SysExcelWorksheets worksheets; SysExcelWorksheet worksheet; SysExcelCells cells; FileName filename; LabelId labelId; str st1, st2; int row = 0 ; SysLabelEdit SysLabelEdit = new SysLabelEdit(); application = SysExcelApplication::construct(); workbooks = application.workbooks(); //specify the file path that you want to read filename = "D:\\importtest.xlsx"; try workbooks.open(filename); catch (Exception::Error) throw error("File cannot be opened."); workbook = workbooks.item(1); worksheets = workbook.worksheets(); worksheet = worksheets.itemFromNum(1); cells = worksheet.cells(); do { row++; labelId = "@" + cells.item(row, 1).value().bStr(); SysLabelEdit.labelModify('en-us', labelId, cells.item(row,2).value().bStr(), cells.item(row, 3).value().bStr(), SysLabelApplModule::None); } while (row != 4); application.quit(); }


    4784.zz.png

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans