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?