Write To Excel Issue


I am creating a process to enter records in an Excel. I want to enter only unique records. If record already exist in Excel then bot should not enter record in excel. If the record does not exist in excel, then the record should be written.
The method I used was working in 17.5 but it’s not working in 18.0. If the record is not present in excel, the bot throws an error - “Object Reference not set to instance of an object”.

Please help me resolve this issue.


Please elaborate which method were you using in 17.5

For e.g, I need to write “A” into Excel if it’s not present already.

Created an argument e.g., Flag
Inside Excel loop, I gave a condition :- if Column_Name.Equals(“A”)
then Flag = “T” [Means A is present]
Break Excel
After that loop :- if Flag.Equals(“T”)
then Nothing [Black then]
else Write To Excel
Break Excel

My issue has been resolved. It was throwing error when Excel was empty. I provided condition for this and it worked.