The name of the file changes based on months. Every month you have a new file.
I:\Test\Data_201303.xlsx
How do I set up a connection manager that will work with variable file paths?
Step 1: Create a package and create a new connection (in the connection panel, right click and choose Excel connection) with an Excel connection and connect to the sample1 excel file given above. Step 2: Declare a variable “ExcelFileName” as string and Assign static value to the package variable.
Look for the "expression" property on the connection manager. That's where you set it to USER::VariableName.
More detail: if you "edit" the connection manager it will show you the edit window. That's not the one you want. Look at the "properties" window, which is where you will find the "Expressions" entry, in front of an empty box.
Click on the empty box, and it will show you a button with three dots on it. Click on that button. This pulls up the "Property Expression Editor". There is a dropdown with properties like "ConnectionString" on the left. On the right, there is ANOTHER button with three dots. Click on that button to pull up the "Expression Builder". If you have declared any variables, you will find them listed in the upper left hand corner, e.g., as User::VariableName, and you can then drag them into the Expression box, where they will appear as @[User::VariableName].
Not obvious, but doable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With