First suggestion is to format your code properly so that we can read it
Next, where is it breaking? Are you getting to the point of showing your filepath?
It would definitely be worth your effort to move away from VB and towards C#. C# is preferred for Epicor customizations.