Posted: 6 Mar 2018 20:49 EST Last activity: 8 Mar 2018 21:24 EST
Updating a file while RPA has control over it
Have a requirement in a RPA automation, the robot opens a remote excel file laying in the network to pick some values.Another team from the same company should be able to update the excel while robot is processing.The thing I noticed is, If any user uses the same excel opened by the robot, there will be no exceptions. But, if somebody tries to open the excel again in their machine while the robot is in process, the bot will throw an exception. So my approach is to keep two copies of the excel called "working copy(one that the RPA opens)" and "remote copy" and then wait until the robot finishes the process and save as the remote copy to the folder where the working copy is.But then the robot shows a model dialog asking whether to replace the existing file. which the RPA bot cant handle.How should I handle this requirement?
We shouldn't be restarting the bot after modifying the excel.That's the requirement.
Is it possible to import the excel to a data table so that the excel data is in the memory and copy the data in to the memory every time the process starts?But still there will be an error if the user tries to update the excel while automation tries to copy the excel data to the data table.So want to know if somebody has solved a requirement like this.
A simpler approach would be to copy the excel locally using CopyFile(2 parameters) found in FileUtils then use your local copy for the robot. When you are done processing and have updated the sheet copy the lcoal sheet back to the share using CopyFile(3 parameters). The CopyFile with 3 parameters will allow you to tell the file to overwrite.
Thanks Grona and Jeff.....I think using the FileUtils is the option if there's a strict requirement to use the excel. I have another idea.If we can use a SQL table to store the data rather than an excel, we can actually handle the concurrency as well. So if the client want an interface, we can build a separate UI to update the SQL table or use a local copies of the excel for users to update and use an automation to update the SQL table using the excel data.