Reputation: 761
He everyone! I am new to office embedded developing. I have a part of code which has to find value in a range but its always returns as null: (i - is iterator index)
xlWorkSheet.Cells[100, 100] = karts[i].minTime.ToString();
Excel.Range a = xlWorkSheet.Range["D2", "N2"].Find(xlWorkSheet.Cells[100, 100]);
if(a!=null)
a.Borders.Color = 3;
So when I found a value in range i want to border it but if is always skipped by null.
Upvotes: 0
Views: 431
Reputation: 83
You should write
while(a!=null)
{
a.Borders.Color = 3;
}
Because Find will only look for the first object all acording to Microsoft How to:
Upvotes: 2