I currently have this C# code that has access to table1. I am having an issue however with Var listRowsValue and var lr. How can I print these and subtract 1 off of ListRowsValue and not view "System._ComObject" as an output? How can I resize ListObject to not check another row at the end of the count?
var listRowsValue = xlWorkBook.Worksheets["Sheet1"].ListObjects["table1"].ListRows;
for (int CurrentRow = 0; CurrentRow < listRowsValue.Count; CurrentRow++)
if (xlWorkBook.Worksheets["Sheet1"].ListObjects["table1"].Range[CurrentRow, 2].value == -1)
xlSheet.Cells[5, 5] = "YES!";
var lr = listRowsValue[CurrentRow];
Console.WriteLine("CURRENT ROW: " + lr);//Why does this not work?
//How do I resize the total listRowsValue count here so it doesn't check another row at the end?
//EXAMPLE: ListRowsValue = ListRowsValue - 1;
//CurrentRow = CurrentRow - 1;
xlSheet.Cells[5, 5] = "NO!";
For CurrentRow = 1 To Tablesize
If Lo.ListColumns("Column2").DataBodyRange(CurrentRow) = -1 Then
MoveEmUpOne Lo, CurrentRow, Tablesize
Tablesize = Tablesize - 1 'table didn't really get smaller, but number of "real"rows decreased by 1
CurrentRow = CurrentRow - 1 ' check this row again -- stuff from below might need cleard