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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Get Column Name of Microsoft Excel

(0) ShareShare
ReportReport
Posted on by 922

Hello,

I try to import an excel file to ax so i can get  the value of specific column using this : 

SysExcelCells.item(rowIdx, columnIndex).value()

Is there anyway to get the Column Name  ?

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    306,773 Super User 2026 Season 2 on at

    Hi Alex,

    What technology are you using to import the excel file? Data Import Export Framework or custom coding? What is the purpose of getting the Column name? Are you searching for 'A','B','C' etc or the field name on the first row?

  • ALAhmed Profile Picture
    922 on at

    Hi André,

    I'm using the custom code and i search the field name of the first row.

    I’ll explain my problem , the list of column name is setting in one form and when I import the file  I have in this file two column with Amount value.(like 423.42 & 4567.66). In Excel when we change the point by comma in the value of amount ,after the import we get only for (423,42 & 4567,66) => .( 423 & 4567). Without the decimal value.This is coming when we use this function

    Cellstr = this.COMVariant2Str(cells.item(rowIdx, columnIndex).value());

    // convert into str from excel cell value

    str comVariant2Str(COMVariant _cv, int _decimals = 0, int _characters = 0, int _separator1 = 0, int _separator2 = 0)

    {

    }

    Here by default I have decimals = 0 but I want change this decimals to 2 for only two column.

    Actualy I’m do that and it’s work but what if the order of field change in the parmeter form..

    if(columnIndex == 6 || columnIndex == 7)

    {

      Cellstr = num2str(cells.item(rowIdx, columnIndex).value().double(),0,2,0,0);

    }

  • ALAhmed Profile Picture
    922 on at

    Hello ,

    IT's ok i 'm using this :

    if(sauParmCopyPasteLines.FieldId == fieldNum(LedgerJournalTrans, AmountCurDebit)

    || sauParmCopyPasteLines.FieldId == fieldNum(LedgerJournalTrans, AmountCurCredit) )

    instead of  if(columnIndex == 6 || columnIndex == 7)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans