If you make that inside SolidWorks, i.e. as a SolidWorks macro, then there is the following possiblity:
- add PDMWorks Enterprise ??? Type Library in Tools/References
- define vault as IEdmVault5, not as Object
- define file as IEdmFile, not as Object
- call GetFileFromPath without the second parameter (it may still work without the second parameters, but I did not test. At least it must be defined as correct PDM type (IEdmFolder5) istead of Object)