Never mind, I figured it out. It was basically just syntax, as expected...
I did modify the code so that the "Line" variable contains the entire path, filename, and necessary syntax, so it looks like:
Line = MyPath & "[" & myFile & "]" & wsname & "'"
And the final code looks like:
f = "=IfError(match(""" & Text & """, " & Line & "!$B:$B,0),""not found"")"