Have a look into the API help for the GetOpenFileName method of the SldWorks object. An example is shown there.
Try these codes:
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
If swModel.GetPathName = "" Then
also look into using the microsoft scripting runtime, specifically the filesystemobject has some nice features for working with files and such. it does require a reference though... so it may not be right in every situation.