I'm trying to load data from an excel file with a sheetname which is not static (sheetname contains yyyymmdd which would change with each file) into SQL database table. I followed the solution provided on How to loop through Excel files and load them into a database using SSIS package? but could only manage to get the first for loop working. When I'm trying to assign the user variable 'Sheetname' to Excel Source under the Data Flow task, I'm getting the error -
Error at CSSN_Invoice [Connection manager "TEST MKBS CONNECTION"]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft Access Database Engine" Hresult: 0x80004005 Description: "Invalid argument.".
Error at Data Flow Task [MKBS Sheetname [1]]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "TEST MKBS CONNECTION" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed
The data flow task is working fine when a sheetname is picked as 'Table or View' and not as 'Table Name or View Name Variable'
Please help !