Event handler for excel source in for each loop

  • Hi, I have a for each loop where in data flow task I have excel source which is looping throuch bunch of excel file. I gotan error in excel source that the file is unredable. I tried to open that particular excel file and was unable to open the file as I was getting error from excel that the file is corrupt.

    Is there any way to handle this event and allow the for each loop to leave the corrupt file and go to the next file because my package got failed.

    Thanks in advance.

  • I have never tried this before but the first thing that comes to my mind looking at the problem you are having is to define an on error event handler for the foreach loop and then write a script to achieve what you want.

    Hope it helps!

  • You could add a dummy task in the for each loop and connect the dataflow to this task using the error path (red arrow).

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply