How to Put paramaters for the MTM test case in excel sheet and call them instead of having them by defining @parameter in test case.
Can it be done by coded UI ? if so how and where to change the file location?
No, you will not be able to do this using MTM only i.e. using the MTM functionality you can't feed your test cases with external sources like an Excel/CSV etc, atleast till version 2013 this functionality is not available. MTM is just a simple recorder which has been designed and provided to help manual tester to ease and accelerate their job of manual testing. All validations (Pass/Fail) still needs to done manually by the tester.
If you want to do Data Driven testing, then you need to take your test cases one step ahead by using Coded UI, it will provide you a lot of features, frameworks and flexibility for creating and maintaining test cases. Using Coded UI you will have two options of doing this.
One is to use the record and playback functionality of Coded UI and then generating code from the recorded test cases. Even, in this step you can save time by using the already recorded test cases of MTM and converting them to Coded UI. You just need to select the option 'Use an existing action recording' over the code generation screen and it will save your time of recording.
By this way your test cases will be available in both MTM and Coded UI. Reference links:
Another option is to use the excel sheet via code in Coded UI test cases. For this you need to write code for using the excel file and pass it to your fields.
Yes, this can be done using CodedUI. There is an excellent, step-by-step instruction here: https://msdn.microsoft.com/en-us/library/ee624082.aspx
See the DataSource examples at the bottom to see how to specify the file location.
It looks like something on the lines that you are after has been implemented in the 2014/2015 branch. I`ll leave some links below so you can take a look for yourself.
I am currently on 2012 and I don`t have that. It looks like we might need to upgrade :)