0

I followed this link on how to loop through all the excels in a folder and loop through excel sheets.

And everthing went on fine, it works as I excpected.

But after the For Each Loop Container for the sheets, I've added a File System Task to move the file to archive folder. And I get a error like this

[File System Task] Error: An error occurred with the following error message: "The process cannot access the file because it is being used by another process.".

NOTE: File System Task is added inside the For Each Loop Container of the excel files.

I guess the error is because of the ADO.NET connection which was estasblished for that particular excel file.

I'm having a very hard time with this, any suggestion or help will be much appreciated.

Thanks in advance.

Community
  • 1
  • 1
Unknown User
  • 3,598
  • 9
  • 43
  • 81
  • After the foreach loop (and outside of it), write a script task that use the file system object to move all the files. – Tab Alleman Jul 06 '15 at 13:22
  • How can we use a script task and move all the files at once to archive? – Unknown User Jul 06 '15 at 13:46
  • I don't understand the question. It's a script task. You can program it to do anything. It can use the file system object to move files. What are you trying to ask? – Tab Alleman Jul 06 '15 at 13:50
  • Try the solutions here: http://stackoverflow.com/questions/2758209/ssis-for-each-file-loop-and-file-system-task-to-copy-files – Tab Alleman Jul 14 '15 at 13:23

0 Answers0