View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
LeAnn LeAnn is offline
external usenet poster
 
Posts: 18
Default FileDialog Question

Thank you Sean & Mike. I will try it out - been working on something else
lately. I'll let you know what works.

"Mike Fogleman" wrote:

Sub test()
Dim PName As String, FName As String
Dim i As Long, Dot As Long

PName = "C:\RootFolder\SubFolder\MyBook.xls" 'full path
i = InStrRev(PName, "\") + 1 'position of last "\"
Dot = InStrRev(PName, ".")
FName = Mid(PName, i, Dot - i)
End Sub

Mike F
"LeAnn" wrote in message
...
Hi,

I have a follow up question to my earlier post - using Excel 2003. I am
able to set the default directory for the user to choose a single file
from.
However, I need to extract the actual filename from the path (excluding
the
extension).

Is there a property that does this? I haven't see anything so far. The
file name length may be variable so my attempt at using a combination of
Left
and Right functions didn't always work.

Any ideas?

Thanks
LeAnn