artigas
12 years agoOccasional Contributor
The process cannot access the file because it is being used by another process.
Greetings -
Step 1) I copy a file into C:\Temp\maintenance_boxfavorites_add.xls [aqFile.Copy() ]
Step 2) I initiate a data driven loop to import the data into a database table.
Step 3) I delete C:\Temp\maintenance_boxfavorites_add.xls [aqFile.Delete()]
All steps complete in the green. Checking I find that the file has not been deleted. Error message is:
The process cannot access the file because it is being used by another process.
Path: C:\Temp\maintenance_boxfavorites_add.xls
I attempted to put a delay of 20 seconds to give the data loop entry
process a chance to complete. This delay did not work, I still get the
error.
function DeleteImportFile()
{
BuiltIn.Delay(20000,"Waiting for last operation to finish");
aqFile.Delete("C:\\Temp\\maintenance_boxfavorites_add.xls");
// BuiltIn.Delay(2000,"Waiting for last operation to finish");
}
I have uploaded a picture to show the condition at the end of the test.
Need some suggestions here.
Thanks In Advance
Step 1) I copy a file into C:\Temp\maintenance_boxfavorites_add.xls [aqFile.Copy() ]
Step 2) I initiate a data driven loop to import the data into a database table.
Step 3) I delete C:\Temp\maintenance_boxfavorites_add.xls [aqFile.Delete()]
All steps complete in the green. Checking I find that the file has not been deleted. Error message is:
The process cannot access the file because it is being used by another process.
Path: C:\Temp\maintenance_boxfavorites_add.xls
I attempted to put a delay of 20 seconds to give the data loop entry
process a chance to complete. This delay did not work, I still get the
error.
function DeleteImportFile()
{
BuiltIn.Delay(20000,"Waiting for last operation to finish");
aqFile.Delete("C:\\Temp\\maintenance_boxfavorites_add.xls");
// BuiltIn.Delay(2000,"Waiting for last operation to finish");
}
I have uploaded a picture to show the condition at the end of the test.
Need some suggestions here.
Thanks In Advance