LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Use Dir() to fill out missing components from Path?

I’d like a way to flesh out a file’s path the way the Dir() function
does. The Dir() function (like the DIR command in DOS) fills in
missing components depending on what the current Path is set to.

Suppose the current Path is

C:\BigFolder

Then all of the following

Dir(“SubFolder\myfile.xls”)
Dir(“C:SubFolder\myfile.xls”)
Dir(“C:\BigFolder\SubFolder\myfile.xls”)

...will be treated as attempts to find this file:

C:\BigFolder\SubFolder\myfile.xls

If the User enters any one of the above strings, I’d like to tell
them:

You are trying to access C:\BigFolder\SubFolder\myfile.xls

And if they just enter the string “OtherFile.xls”, I’d like to respond
with:

You are trying to access C:\BigFolder\OtherFile.xls

...etc. I’d like to be able to make the responses WHETHER THE FILE
EXISTS OR NOT, so that if the file does NOT exist, my error message
can include the whole attempted path.

Is there some easy way I haven’t thought of to do this? I’m guessing
you’d have to treat all these cases separately. Or does someone have
an already-written routine that would do this?

Dan Williams
danwPlanet
 
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
Missing fill handle Speedbump Excel Discussion (Misc queries) 0 May 27th 10 09:53 PM
Fill-in missing information below LuisM Excel Discussion (Misc queries) 2 March 6th 10 06:55 PM
FILL COLOR BOX MISSING Louie Excel Discussion (Misc queries) 1 October 17th 05 09:08 PM
Fill in missing months Charles P. \(Pat\) Upshaw Excel Discussion (Misc queries) 4 June 9th 05 04:11 AM
Missing WrapText from range object in Office Web Components Ricci Gian Maria Excel Programming 0 May 21st 05 10:29 AM


All times are GMT +1. The time now is 07:14 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"