Agreed, but it will work only if the file exists on the user's machine. If
it's just a string- parsing exercise without real files (or with files on
another machine), Dir will yield a blank.
--
Vasant
"Tushar Mehta" wrote in message
news:MPG.1a9aaa7e4547571d9896ed@news-server...
Nice!
--
Regards,
Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
In article ,
says...
Another way ..
Sub TesterII()
Dim str As String
Dim xfile As String
Dim xpath As String
str = "D:\Development Path\Main Files\Test Procedures\Sample Data.mdb"
xfile = Dir(str)
xpath = Left(str, Len(str) - Len(xfile))
MsgBox xfile
MsgBox xpath
End Sub