Forum Discussion

masalvacion's avatar
masalvacion
New Contributor
9 years ago

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

  • 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