PDM api search and get latest version

I am trying to incorporate some code to an excel VBA macro that will do a PDM search for a variable that's already defined and then get the latest version of that file.

Any help is greatly appreciated.  Thanks Eric

SolidworksApi macros