File open

  • Thread starter Thread starter Guest
  • Start date Start date
Not sure exactly what you're asking for.

If you look at the 4 line example at the top of the page, strInputFileName
contains the complete path to the file you've selected.

Do you only want the path out of that? You can use:

Left$(strInputFileName, Len(strInputFileName) - Len(Dir$(strInputFileName)))

or you can use the InStrRev function to find the last \ in strInputFileName:

Left$(strInputFileName, InStrRev(strInputFileName, "\") - 1)
 
Thanks
its working

Alvin


Douglas J. Steele said:
Not sure exactly what you're asking for.

If you look at the 4 line example at the top of the page, strInputFileName
contains the complete path to the file you've selected.

Do you only want the path out of that? You can use:

Left$(strInputFileName, Len(strInputFileName) - Len(Dir$(strInputFileName)))

or you can use the InStrRev function to find the last \ in strInputFileName:

Left$(strInputFileName, InStrRev(strInputFileName, "\") - 1)
 
Back
Top