The door library comes to the rescue:
obj is an Object.
Code:
Sub App_Start
Form1.Show
obj.New1(false)
obj.CreateNew("System.Environment")
fullPath = GetPath("%USERPROFILE%")
Msgbox(fullPath)
End Sub
Sub GetPath (env)
Return obj.RunMethod2("ExpandEnvironmentVariables",env,"System.String")
End Sub