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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Cant able to read the Data from Excel Sheet

(0) ShareShare
ReportReport
Posted on by 456

Hi,

I have to read the Data from Excel sheet. Here below is my Excel sheet.The First item id i cant able to read the Second row i able to read. Any Suggestions please. I have tried formatting Cells but it hasn't help for me.

pastedimage1582867997747v1.png

Regards,

Ram.

I have the same question (0)
  • Suggested answer
    Ziyao Profile Picture
    Microsoft Employee on at

    Hi Ram, normally the first and send row in excel stores header and template information, try to start your first item on Row 3.

    For build in import by excel function, you need to copy paste your data to the excel template exported and then import by system, if this import by excel function is customized, please check your code.

  • Ram Kumar Profile Picture
    456 on at

    Hi Ziyao,

    My code can't able to read the only integer values(Eg:1000), but it can able to read the Values which is Suffixed with String (Eg: "D001"). that's what the issue i am facing now. can you able to understand my issue.

    Regards,

    Ram.

  • Ziyao Profile Picture
    Microsoft Employee on at

    Is this a customized import function or it's a standard build in import function? If it is a build in standard function, could you please indicate where it exactly placed?

  • nmaenpaa Profile Picture
    101,166 Moderator on at

    Can you share with us any details about how you are reading data from Excel sheet? Seems you forgot to mention it.

    Are you using one of the out of the box functionalities (defintion groups, DIXF) or did you write some own code?

  • Ram Kumar Profile Picture
    456 on at

    Hi Ziyao,

    Here is my code to read the Item id from Excel sheet.

    static void ReadingExcel(Args _args)
    {
    SalesTable                             salesTable;
    SalesLine                              salesLine;
    NumberSeq                              numberSeq;
    SalesFormLetter                        salesFormLetter;
    SalesFormLetter_PickingList            salesFormLetterpick;
    SalesId                                salesId;
    InventDim                              inventdim;
    Dialog                                  dialog;
    DialogField                             file;
    SysExcelApplication                     application,application1;
    SysExcelWorkbooks                       workbooks,workbooks1;
    SysExcelWorkbook                        workbook,workbook1;
    SysExcelWorksheets                      worksheets,worksheets1;
    SysExcelWorksheet                       worksheet,worksheet1;
    SysExcelCells                           cells,cells1;
    SysExcelCell                            cell1;
    SysExcelFont                            font;
    COMVariantType                          type,type1;
    FileName                                filename,filename1;
    str Custaccount,itemno,salesunit;
    real quantity;
    real salesprice;
    
    int row=1;
    int row1 = 2;
    dialog = new Dialog("Please select the file to load");
        dialog.addText("Select file:");
        file   = dialog.addField(ExtendedTypeStr("FilenameOpen"));
        dialog.run();
    
        if (dialog.closedOK())
        {
            info(file.value());
    
            application = SysExcelApplication::construct();
            workbooks = application.workbooks();
            //specify the file path that you want to read
            filename =file.value(); //ExcelSheet File Name
            try
            {
                workbooks.open(filename);
            }
    
            catch (Exception::Error)
            {
    
                throw error('File cannot be opened');
    
            }
    
            workbook = workbooks.item(1);
            worksheets = workbook.worksheets();
            worksheet = worksheets.itemFromNum(1); //Here 1 is the worksheet Number
            cells = worksheet.cells();
            do
            {
            row  ;
            itemno = any2str(cells.item(row,2).value().bStr());
            info(itemno);
            type = cells.item(row 1, 1).value().variantType();
            }
            while (type != COMVariantType::VT_EMPTY);
    
            workbooks.close();
            application.quit();
    
            info("Done!");
    
        }
    }

    Regards,

    Ram.

  • nmaenpaa Profile Picture
    101,166 Moderator on at

    And do you get some error when you run it? What error? What line of code causes the error?

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 March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 653

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 493 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 317 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans