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 8640617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:19:24+00:00 2026-06-12T11:19:24+00:00

Is it possible to make an application that reads multiple excel files from a

  • 0

Is it possible to make an application that reads multiple excel files from a folder and extracts some information from them?

  • 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-12T11:19:25+00:00Added an answer on June 12, 2026 at 11:19 am

    Yes it is, and here is how using Interop. The first thing you need to do is add the Excel Interop library to your project. You can do this by creating a new Visual Studio solution, right clicking on References, selecting Add Reference and then selecting Microsoft.Office.Interop.Excel from the .NET tab.

    Then you need to add a using statement for Excel, and one for InteropServices (as we are interoping with a COM object):

    using Excel = Microsoft.Office.Interop.Excel;
    using System.Runtime.InteropServices;
    

    Then, inside a method, you need to create an Application object:

    Excel.Application application = new Excel.Application();
    

    Next, create a Workbook object for each workbook you want to read from, like so:

    Excel.Workbook workbookOne;
    Excel.Workbook workbookTwo;
    Excel.Workbook workbookThree;
    

    Now use the Application object to open each workbook, and load each one into its respective Workbook object:

    workbookOne = application.Workbooks.Open(@"C:\workbookOneLocation.xlsx");
    workbookTwo = application.Workbooks.Open(@"C:\workbookTwoLocation.xlsx");
    workbookThree = application.Workbooks.Open(@"C:\workbookThreeLocation.xlsx");
    

    Now you need to decide what information you want to extract. Once you have done this determine which worksheet in the workbook it is on,and then figure out the number by simply looking at the tabs and counting. In the below example, Sheet2 is number 1, Sheet1 is number 2 and Sheet3 is number 3:

    Example

    Create a variable for each piece of information you need like so (any value type variables will need to be nullable):

    string firstPieceOfInformationINeed;
    string[] secondPieceOfInformationINeed;
    double? thirdPieceOfInformationINeed;
    

    Let’s say that the first piece of information we need is a string in Cell A1 on sheet one inside workbook one, the second piece is Cells B2 – B4 on worksheet two inside workbook two, and the third piece is a number on cell C5 on worksheet three inside workbook three. We would do this:

    string firstPieceOfInformationINeed;
    string[] secondPieceOfInformationINeed;
    double? thirdPieceOfInformationINeed;
    
    Excel.Worksheet worksheet;
    Excel.Range range;
    
    worksheet = workbookOne.Sheets[1];
    range = worksheet.Cells["1", "1"];
    
    firstPieceOfInformationINeed = range.Value as string;
    
    worksheet = workbookTwo.Sheets[2];
    range = worksheet.Range["B2", "B4"];
    
    secondPieceOfInformationINeed = range.Value as string[];
    
    worksheet = workbookThree.Sheets[3];
    range = worksheet.Cells["3", "5"];
    
    thirdPieceOfInformationINeed = range.Value as double?;
    

    Then we close the workbook, using a boolean value to indicate whether or not we want to save changes:

    workbookOne.Close(true);
    workbookTwo.Close(false);
    workbookThree.Close(true);
    

    Now quit the application:

    application.Quit();
    

    And release the COM object:

    Marshal.ReleaseComObject(application);
    

    Now you are done with Excel, and have all of the different pieces of information you need stored as C# variables, and you can do with these what you wish.

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

Sidebar

Related Questions

Is it possible make some handler that will do something when user shutdown computer
Possible Duplicate: python: how to encrypt a file? I'm trying to make application that
I want to make a desktop application that can read the SMS from the
Is it possible make an activity, that will lock the android device? That device
Possible Duplicate: Make iPhone app paid version replace free version on install from app
I have a simple app that reads internet resource and displays the information in
I have an application that deals with clients from all over the world, and,
I have a Scala application that relies on an external RESTful webservice for some
Is it possible to develop a web page that reads digital certificates available in
I am making an java application which reads a file from a particular location.

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.