Hello,
I have a robot that downloads an xls file from a web site. It then opens it with Excel application in order to apply some reformatting. The excel actions are executed inside an Excel Application Scope.
According to documentation and if I’m not wrong, the Excel files are closed when the application scope activity ends. Unfortunately this does not happen every time: there are times when the XLS remain open even after the robot has ended. This problem is more frequent when I run the robot from the Robot Tray rather than from Studio.
I also tried to specify a WorkbookApplication variable, then to explicitly call CloseWorkbook at the end, with no success.
Is there a safe and deterministic way to close Excel at the end of an Application Scope ?
Close workbook needs to be OUTSIDE of the excel application scope.
I’ve also noticed that sometimes it needs to have a few extra milliseconds between the end of the excel scope and the close workbook activity for it to workproperly. Just put in a write line activity or a super short delay activity in between if needed.
I had to find a different way: I save the file to a local temp folder, then I close the Excel scope, then I move the file to the network folder. This appears to work in all conditions (both attended and unattended).