From a directory that contains multiple folders, I’m opening text file with excel from each folder, changing the content of excel, saving back it into same text format and compressing each folder.
In the end I’m cleaning up the folders in the directory. While performing this action i’m getting error as : the process cannot access the file because it is being used by another process. Can anyone help me on this.
I’m opening the text file using processStart = System.Diagnostics.Process.Start(“EXCEL.Exe”, File.ToString). When I’m commenting this portion of code, The files are getting deleted properly. I suspect there is some issue cleaning the files which I’m opening using processStart. Do I need to kill the process after I’m opening text file with processStart.