Can anyone tell me what I a doing wrong with this code? I am trying to read in a cell and assign the value to the String node1.
public void createEdgeListFromRange(Microsoft.Office.Interop.Excel.Workbook workbook)
{
Excel.Worksheet ws = (Excel.Worksheet)workbook.Worksheets.get_Item("Time Series");
Excel.Range range = ws.UsedRange;
for (int row = 0; row < range.Rows.Count; row++ )
{
String node1 = ws.Cells["A", row].ToString;
}
}
You have a typo:
because
ToString()is a method call,ToString(if it exists) is a property (or field) call.