View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Charles Chickering Charles Chickering is offline
external usenet poster
 
Posts: 272
Default just file name no path

What if they are using a cursed Mac? <gr

--
Charles Chickering

"A good example is twice the value of good advice."


"Dave Peterson" wrote:

If you're using xl2k or higher, you could use instrrev() to find the last \.

dim filetoopen as variant
dim JustFileName as string
fileToOpen = Application.GetOpenFilename("DBF Files (*.dbf), *.dbf")
if filetoopen = false then
exit sub
end if
justfilename = mid(filetoopen,instrrev(filetoopen,"\")+1)





"musa.biralo" wrote:

Hi
is there a way to get the file name only? Using this
fileToOpen = Application.GetOpenFilename("DBF Files (*.dbf), *.dbf")

i got complete path. i want the path as well as file name. So, for
path this is ok to me but not for the file name. Please help me or
direct me to the right place.

musa.biralo


--

Dave Peterson