You have not said if the code returns an error or you simply do not get a file name returned to the variable myFile.
If the problem is just not returning a value to myFile then the path at Location might be invalid.
If you are getting an error then because Location is a defined name then I suggest that there might a problem with the defined name or the contents of the cell.
On the worksheet, select Name manager and ensure that there is not an error in the defining of the Named range like #Ref in the Refers to field.
If previous step is OK then check that you have a valid path in the cell.
If still looks OK then insert a line like the following to print the string attached to the Dir command to the Immediate window and you will probably see what the error is. (the line of code needs to be immediately prior to the Dir line like the following.
'Target Path with Ending Extention
Debug.Print [Location] & "" & myExtension 'Insert this line
myFile = Dir([Location] & "" & myExtension)
Just in case you are not familiar with the Immediate window, in the VBA editor, open if with Ctrl and G.