Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Enumerator cannot enumerate multiple Excel files/worksheets Expand / Collapse
Author
Message
Posted Sunday, June 12, 2011 10:10 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, November 12, 2014 1:49 PM
Points: 115, Visits: 818
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
Post #1124023
Posted Tuesday, April 3, 2012 12:28 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 22, 2012 10:51 AM
Points: 2, Visits: 61
is there a solution to this? I'm having the same problem...
Post #1277550
Posted Wednesday, April 4, 2012 12:38 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, August 27, 2014 1:05 PM
Points: 157, Visits: 292
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
Post #1277809
Posted Tuesday, December 11, 2012 10:00 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Monday, October 13, 2014 12:01 AM
Points: 780, Visits: 495
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?

Post #1395419
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse