How to declare a path in invoke code as a variable

Surround with Try Catch to get more information about exception.
Writing exception.ToString will show you more accurate exception message.