So I have kind of a general question here regarding Interop operations on Microsoft Excel Sheets. To give you some background, I have been tasked to write a tool in C# to read and manipulate large Excel sheets.
Now, I have come across the question whether it would be better to read an Excel file into an array all at once or cell by cell in terms of performance.
The latter meaning looping through the whole sheet and creating thousands of access requests, but only gathering the information really needed. Also, Interop seems to produce random COMExceptions pretty frequently, slowing up the whole process.
On the other hand though, reading the whole sheet at once, while not every piece of information is needed, creates a lot of data overhead that can get heavy on storage and runtime performance. The advantage being the need for only a single Interop request, avoiding most Interop COMExceptions.
So which method would you prefer?