Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default File Path Class

Does anyone have a nice file path class that can work regardless of
whether or not the path exists? The MS Scripting Runtime object model
provides file and folder objects which are good, but they don't work on
hypothetical paths... also, I think they introduce more overhead than a
simple Path class would that merely stores the current path and can
return new path classes to its parent or to its children, or can return
it's FullName optionally with or without the drive, path, name, extension...

Any help would be appreciated!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default File Path Class

If using at least xl2000 or later, why not just use split

vArr = Split(sPath,"\")

ext = split(varr(ubound(varr)),".")(1)
name = split(varr(ubound(varr)),".")(0)

--
Regards,
Tom Ogilvy


"R Avery" wrote in message
...
Does anyone have a nice file path class that can work regardless of
whether or not the path exists? The MS Scripting Runtime object model
provides file and folder objects which are good, but they don't work on
hypothetical paths... also, I think they introduce more overhead than a
simple Path class would that merely stores the current path and can
return new path classes to its parent or to its children, or can return
it's FullName optionally with or without the drive, path, name,

extension...

Any help would be appreciated!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default File Path Class

That would be the method internal to the Path class. The reason why I
want a class to do this is that it is tedious to, for example, get the
path of the parent's parent folder. I would have to take the ubound of
the array, iterate over each element in the array until ubound-3,
properly join them with the appropriate path separator, etc. I just
want a one-line command to do it, since I have to do it all the time.

Also, a class could be designed to handle UNIX, Windows, and (perhaps)
Mac paths natively. It could also have built in functions to test
whether or not the path exists, if it is a folder or file, return a
scripting.file object corresponding to the path, etc.




Tom Ogilvy wrote:

If using at least xl2000 or later, why not just use split

vArr = Split(sPath,"\")

ext = split(varr(ubound(varr)),".")(1)
name = split(varr(ubound(varr)),".")(0)

Reply
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
File Path Too Long? Not Anymore! Check out Long Path Tool Max Loger Excel Discussion (Misc queries) 1 March 24th 17 07:59 AM
http://CannotDeleteFile.net - Cannot Delete File? Try Long Path ToolFilename is too long? Computer Complaining Your Filename Is Too Long? TheLong Path Tool Can Help While most people can go about their businessblissfully unaware of the Windo Max Loger Excel Discussion (Misc queries) 0 June 14th 11 04:30 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
How set file open path to filepath of file opened with Explorer ? RandyDtg1 Excel Programming 0 May 14th 04 02:05 AM
class module in a xla file isabelle Excel Programming 3 March 3rd 04 01:21 PM


All times are GMT +1. The time now is 07:07 PM.

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

About Us

"It's about Microsoft Excel"