I’m using Interop to work with Excel in C#. I need two cells. This is how I get them:
cells = (Excel.Range)sheet.get_Range("V" + i, "W" + i);
System.Array values = (System.Array)cells.Cells.Value;
This returns the values I want, as tested with a foreach loop. But how do I get the elements into string variables? I tried this:
var stringValues = values.Cast<string>();
but I can’t access it in any way without raising an error.
A simple
ConvertAllshould suffice: