SSIS for each file system and file system Task to copy files

I am using the filesystem task inside a for each container for the loop as described here: link text

However, when I execute the package, I get this error: Error [File System Error]: An error occurred with the following error message: "The process cannot access the file 'C: \ Book1.xlsx' because it is being used by another process ".

I don't have the file open, and I'm assuming no one else is doing this, since I can copy, open and overwrite the file.

Any suggestions would be appreciated. If you need plz package please let me know.

+2


a source to share


2 answers


I figured out the problem. Be sure not to create connections to the file (you can see them in the Connection Managers tab) that are stored in the same variable as the path you are using for the source file in the Filesystem.



+2


a source


Since it took me many hours to solve, I am posting my solution for others. And it was very simple ...



Place a copy of your Excel file in a different folder and name it "template.xlsx". Connect your circuit to this copy. The actual Excel file will no longer be locked by the ForEach Worksheet outline outline!

+1


a source







All Articles