Reputation:
I'm trying to write an Excel add-in using Microsoft Visual C# and VSTO. What I'm trying to do is read all of the data in the Excel sheet into a list of some sort so that I can process the list and write the list back to the sheet.
So far I have been unable to get any of the examples of the MSDN site to work.
Upvotes: 0
Views: 248
Reputation: 152521
You read/write the values from a Range
variable into an Array
using its Value
property. From there you can create a list or leave it as an array - your choice.
I will advise you NOT to read or write the 'Value' property of individual cells in a tight loop as you'll have a significant performance penalty. Read the value into an array, modify the array, then write them back at one time.
Upvotes: 1