Error when reading an excel file after being modified

I have a problem reading the excel file throwing the following error Read Range: Object reference not set to an instance of an object.

The cause of this problem is that it works in conjunction with a Javascript code that modifies the excel file, which the robot will read

But I have placed in the robot a try catch to repeat the reading in case it cannot, but it keeps throwing the previous error

I realized that to solve this problem I have to open the excel and select save and there it is solved and the robot can just read it

I DON’T UNDERSTAND WHY THE ROBOT CANNOT READ THE EXCEL FILE MODIFIED BY THE JAVASCRIPT CODE, maybe it generates a cache or something similar, I don’t

I want to solve this problem without having to open excel and save, since it consumes my memory

Hi Borish,

After modifying it with javascript save it and then close all the excel through running process(close it from task manager using kill process and give EXCEL.EXE) then read that file.

hope it will work

Thanks for answering, but I want the robot to work in conjunction with the code, so I don’t want it to open the administrator and close, it can hinder the work flow