I have a simple SSIS 2012 package with:
- A Script Task obtains the latest .xlsx filename from a folder and stores the full path in a package-scoped variable:
SourceFileExcel - An Excel Connection Manager called
FUNBto connect to the file - An Excel Source using the
FUNBConnection Manager
When trying to assign the ConnectionString dynamically, I get error:
[Excel Source [2]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "FUNB" failed with error code 0xC0209303. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
I have tried the following:
- Add the Connection Manager by browsing to the actual file. Connect the Excel Source to it. Preview Data.
Once file loaded manually, update connection manager properties. Set
ConnectionStringExpression:"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+@[User::SourceFileExcel]+";Extended Properties=\"EXCEL 8.0;HDR=Yes; IMEX=1\";"Above produces the error. Change the expression to
ExcelFilePathset to:@[User::SourceFileExcel]
Both the ExcelFilePath and the ConnectionString expressions produce the same error. I have tried both with DelayValidation=True on the Excel Connection Manager and the Data Flow object.
I have another package on the same server that works in much the same way but is using a CSV connection. This package runs normally. The Windows Security Permissions on both source file folders is the same.
Any ideas on what I am doing wrong?