0

I saw a couple of ways and I dont know which one to use. The first one is to write plain code using "using Microsoft.Office.Interop.Excel;" and the other one is from NuGet called "Excel data reader" Ive nevert done this. I have a little experience using VBS on UIPath with managing data tables.

The idea is that later on I'm going to manage that data with Lists and post it to a new excel file. Just need a friendly opinion which tool to use and which one is the fastest to learn.

  • Open excel with peoples Name/workplace/duration
  • Add everyone to some list
  • Sort everyone by day.
  • Create new excel file and add everything there.
Filburt
  • 17,626
  • 12
  • 64
  • 115
  • You can also use [OpenXml](https://learn.microsoft.com/en-us/office/open-xml/how-to-parse-and-read-a-large-spreadsheet) or [EpPlus](https://github.com/JanKallman/EPPlus/wiki/Getting-Started). OpenXml is the Microsoft library to interact with the excels underlying xml files. EpPlus is a third party library that I've been using quite succesfully for a while. I did not thest them against each other so I cannot give you any input. Anyway, [here's](https://stackoverflow.com/a/13396787/8024781) some code to populate a `DataTable` from an excel using OpenXml. – ikerbera Mar 29 '19 at 09:57
  • EPPlus Data Extractor is good. I haven't used Excel Data Reader but it looks like it's doing the same thing. I recommend staying far away from Interop. The other solutions treat Excel as a file and read it, which is good. Interop opens an instance of Excel (which must be installed) and automates it to read data. It's painful and comes with a plethora of unpleasant surprises. It's also slower because opening and running Excel and then using it to open a file takes much longer than just opening a file. – Scott Hannen Mar 29 '19 at 11:45
  • The catch is the sorting. That might give you issues because that's something done from with the Excel app. It's not a function of reading and writing files. You might have to work around that reading the entire sheet, adding new data to your collection, sorting it, and re-writing the whole thing to your worksheet. Still way better than Interop, though. – Scott Hannen Mar 29 '19 at 11:48
  • yea thanks. I already finished reading everything and sorting with columns. Now all thats left is rearange that data in a way I want. So a couple of classes and then everything back to new excel worksheet. Thanx guys. As a junior in programming its amazing how well stack overflow community helps each other. – William Mar 29 '19 at 13:30

0 Answers0