LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #16   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Stripping Path from File String

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



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenate path and file string for external reference Michael[_4_] Excel Worksheet Functions 5 May 21st 23 11:44 AM
Relative Path in Connection String Breunus Excel Discussion (Misc queries) 2 July 29th 09 05:10 PM
How to extract only file name from folder path string in Excel? JayKay Excel Worksheet Functions 1 March 20th 09 04:57 PM
Formula too long - new file path is shorter than old file path - Excel 2003 Greg J Excel Worksheet Functions 1 November 22nd 06 05:16 PM
Using a variable string in a file save path Ron[_13_] Excel Programming 1 October 16th 03 08:29 PM


All times are GMT +1. The time now is 02:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"