Enumerator cannot enumerate multiple Excel files/worksheets

  • G'day,

    We received a number of Excel files from a customer containing sales data I need to load into a database. Each spreadsheet contains a number of worksheets (varies from 5 to 12). I'm trying to write an SSIS package that will read the data from Excel and write it into a table in my database.

    I've looked around, and figured out how to nest a For Each container within another For Each container. The outer container gets the list of files in a directory, and passes each file into the inner container. The inner container opens the file, loops through each worksheet, and inserts the data. Works great in a test envoronment where there is not any data in the spreadsheet. But when trying to use it with the real files, the package opens the first file and loops through all the worksheets, but fails when it moves on to the second file, with the following error:

    The GetEnumerator method of the ForEach Enumerator has failed with error 0x80004005 "Unspecified error". This occurs when the ForEach Enumerator cannot enumerate.

    Does anybody have any ideas?

    Cheers,

    Tom

  • is there a solution to this? I'm having the same problem...

  • Hi,

    I havn't tried this before using inner For Each loop but pls try using script component to assign the file collection paths for all excel files and sheets and use single For Each loop container.

    Thanks

  • If you are running this off BIDS, right click on the Project properties > Configuration Properties > Debugging. Set the Run64BitRunTime to False.

    If you are running it standalone using the DTEXEC tool, try using the 32-bit/64-bit version of the tool depending on the version of the ACE driver that you have installed - You are using the ACE OLEDB Driver right?

  • Thanks a lot Gogula G. Aryalingam. This solution totally worked.

Viewing 5 posts - 1 through 4 (of 4 total)

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