I need to process Excel files saved in a specific folder.
In my SSIS package I added a Foreach loop configured as a File Enumérator, populating a filepathvariable. Then, a script task use this variable to open the Excel file and process it.

However, I'm not able to open the OLEDB Connection to my file in the script task.
The filepathcontains the valid path. I added a test in my script to check the file.
Here is a sample of my code :
// Check file to process.
string rawfilePath = Dts.Variables["User::FilePath"].Value.ToString().Replace(@"\",@"\\");
if (rawfilePath == String.Empty || !File.Exists(rawfilePath))
Dts.Events.FireError(0, SCRIPT_TASK_NAME, "Invalid input file '" + rawfilePath + "'...", String.Empty, 0);
MessageBox.Show(rawfilePath);
// Open connection.
string rawFileConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source='"
+ rawfilePath + "';Extended Properties='Excel 12.0;HDR=NO;IMEX=1'";
MessageBox.Show(rawFileConnectionString);
OleDbConnection rawExcelConnection = new OleDbConnection(rawFileConnectionString);
rawExcelConnection.Open();
My folder is C:\TestFolder. It contains two files : C:\TestFolder\export_20140101.xls and C:\TestFolder\export_20140102.xls.
Here is the error :

In English
Exception has been thrown by the target of an invocation
rawExcelConnectionor theOpencall? - billinkc