Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8523043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:17:53+00:00 2026-06-11T07:17:53+00:00

I have to read from a Excel file using X++ Code. Bellow is the

  • 0

I have to read from a Excel file using X++ Code. Bellow is the some content as part of a large excel file. I would only need to filter list *_BillingCode, *_PSN, AccDistRuleAdvLedgerEntryExt etc on the basis of Public Sector in first column cells.

Public Sector SL1   *_BillingCode
Public Sector SL1   *_PSN
Public Sector SL1   AccDistRuleAdvLedgerEntryExt (Class)
Public Sector SL1   AccJourRuleAdvLedgerEntryExt 
Public Sector SL1   AccountantActivities
Public Sector SL1   AccountingManagerActivities
Public Sector SL1   AdvancedLedgerEntry (Class)
Public Sector SL1   AdvLedgerEntry (Prefix)
Public Sector SL1   AxAdvancedLedgerEntry (Prefix)
Public Sector SL1   AxdAdvancedLedgerEntry
Public Sector SL1   AxdCustomerTransaction (Class)
Public Sector SL1   BudgetAccountDetail (Prefix)

I searched on google I found following lines of code to read from excel file.

    static void ReadFromExcel(Args _args)
    {
    SysExcelApplication application;
    SysExcelWorkbooks workbooks;
    SysExcelWorkbook workbook;
    SysExcelWorksheets worksheets;
    SysExcelWorksheet worksheet; 
    SysExcelCells cells;
    COMVariantType type;
    int row;
    CustAccount account;
    CustName name;
    #define.Filename('C:\\X++ Ownership.xls')
    ;
    application = SysExcelApplication::construct();
    workbooks = application.workbooks();
    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++;
    account = cells.item(row, 1).value().bStr();
    name = cells.item(row, 2).value().bStr();
    info(strfmt('%1 - %2', account, name));
    type = cells.item(row+1, 1).value().variantType();
    }
    while (type != COMVariantType::VT_EMPTY);
    application.quit();
    }

It is taking time to understand how could I utilize the above code, in order to meet my requirements. I would be thankful for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:17:54+00:00Added an answer on June 11, 2026 at 7:17 am

    There are better ways to read Excel files, see Axaptapedia (I am the author by the way).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got the following code from here to read an Excel file using
I have wrote a code that can read an excel 2007 file using Microsoft
I have a Excel File, i am able to read single row from Excel
I'm trying to read from excel file with oleDB provider using C#: using (var
I'm trying to read an Excel (xlsx) file using the code shown below. I
I need to import some data from a excel file and a folder with
I am using xlsread in MATLAB to read in sheets from an excel file.
Need to be able to read an Excel file uploaded using FileUploadControl in ASP.NET.
I am writing some code to read an excel file, but unfortuantely the excel
I have read from some article that say's Apple doesn't approve the application which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.