SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Enumerator cannot enumerate multiple Excel files/worksheets


Enumerator cannot enumerate multiple Excel files/worksheets

Author
Message
Tom Bakerman
Tom Bakerman
SSC Veteran
SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)

Group: General Forum Members
Points: 285 Visits: 930
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
Rocco.Sansotta
Rocco.Sansotta
Grasshopper
Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)

Group: General Forum Members
Points: 12 Visits: 61
is there a solution to this? I'm having the same problem...
Gopi S
Gopi S
SSC Veteran
SSC Veteran (227 reputation)SSC Veteran (227 reputation)SSC Veteran (227 reputation)SSC Veteran (227 reputation)SSC Veteran (227 reputation)SSC Veteran (227 reputation)SSC Veteran (227 reputation)SSC Veteran (227 reputation)

Group: General Forum Members
Points: 227 Visits: 325
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
Gogula G. Aryalingam
Gogula G. Aryalingam
SSC Eights!
SSC Eights! (812 reputation)SSC Eights! (812 reputation)SSC Eights! (812 reputation)SSC Eights! (812 reputation)SSC Eights! (812 reputation)SSC Eights! (812 reputation)SSC Eights! (812 reputation)SSC Eights! (812 reputation)

Group: General Forum Members
Points: 812 Visits: 510
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?
praneetha.gulipalli
praneetha.gulipalli
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 0
Thanks a lot Gogula G. Aryalingam. This solution totally worked.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search