masalvacion
9 years agoNew Contributor
Object required error on While loop
Hi,
I encountered an error stating "Object required" error on the While loop statement.
Kindly see the attached image for reference. I hope you could help me! Thank you in advanced!
Hi masalvacion,
at lane 14, when you do
var b = Excel.Cells(12,2);
you get a reference on the cell object, not the value of the cell.
Like this, you try to compare an integer with an object that produces the error.
Try
var b = Excel.Cells(12,2).Value;
Regards,
Christophe