50 thoughts on “Read Excel Files in C# .NET Core

    1. Hey Satish , you will need to add below namespace
      “using DocumentFormat.OpenXml.Spreadsheet”

      Also additionally you may need

      using DocumentFormat.OpenXml;
      using DocumentFormat.OpenXml.Packaging;

    1. Hi Evan- You can very much do that. Please check “write excel” file part of the article, as I have used the model for the same.

  1. I need to read a csv file that create an xlsx file with with data and graphs. Will Open XML SDK allow me to do this?

  2. i need to work with dataset which contains multiple datatables and each data table should be saved into individual sheeets in single excell file.

    1. Hi Jhansi- Thanks for your query. Please use the above Write logic for the same and extend it. It should perfectly work for your requirements. Here you should iterate over all tables from the given dataset by keeping excel handle open and each table can be written each sheet.

    1. Hey Deepak- Thanks for your query! You need to iterate over the columns and set your criteria based on column name and value (if relevant) for columns you are looking for .Hope this helps!

  3. Thanks for your post, it is really helpful!
    Is there a way to set the width of a cell when i append it to the row? My header data is quite wide.

    1. Hello Lilly. Glad you liked the article.
      You can use Cell ‘Column’ properties to define the required width of your header. Hope this helps.

Leave a Reply

Your email address will not be published. Required fields are marked *