ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   path strings (https://www.excelbanter.com/excel-programming/289813-path-strings.html)

Jack Clift

path strings
 
I am wondering if there is a function that returns /
converts the 'old' path format (i.e. maximum of 8
characters) from the new (long file name) format e.g.

c:\documents and settings\administrator\desktop\
=
c:\docume~1\admini~1\desktop

Thanks

Jack

Bob Phillips[_6_]

path strings
 
Jack,

Not that I know of. Shouldn't be difficult though, it is just first 6 chars
& ~1. Check if that already exists if so make it ~2 etc.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jack Clift" wrote in message
...
I am wondering if there is a function that returns /
converts the 'old' path format (i.e. maximum of 8
characters) from the new (long file name) format e.g.

c:\documents and settings\administrator\desktop\
=
c:\docume~1\admini~1\desktop

Thanks

Jack




Hank Scorpio

path strings
 
On Sat, 31 Jan 2004 10:05:27 -0000, "Bob Phillips"
wrote:

Jack,

Not that I know of. Shouldn't be difficult though, it is just first 6 chars
& ~1. Check if that already exists if so make it ~2 etc.


Actually, there IS one way, if you have the Microsoft Scripting
Library installed, the FileSystemObject can do it for you (make sure
that you only use this with a saved workbook or it'll barf on the
ThisWorkbook.FullName line):

Sub ShowShortName()

Dim fso As Object

'The file to check
Dim fil As Object

Set fso = CreateObject("Scripting.FileSystemObject")

Set fil = fso.GetFile(ThisWorkbook.FullName)

MsgBox "Short path = " & fil.ShortPath _
& vbCrLf & "Short Name = " & fil.ShortName

Set fil = Nothing

Set fso = Nothing

End Sub

"Jack Clift" wrote in message
...
I am wondering if there is a function that returns /
converts the 'old' path format (i.e. maximum of 8
characters) from the new (long file name) format e.g.

c:\documents and settings\administrator\desktop\
=
c:\docume~1\admini~1\desktop

Thanks


---------------------------------------------------------
Hank Scorpio
scorpionet who hates spam is at iprimus.com.au (You know what to do.)
* Please keep all replies in this Newsgroup. Thanks! *


All times are GMT +1. The time now is 10:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com