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: 860
Default Dir("D:\") refresh problem

Hi Alex,

If you don't specify that you're looking for a directory, Dir() will return
the name of the first file found in that folder. So in this case, I'm
assuming that D:\temp\alex\ contains at least one file and that D:\temp\
only contains folders.

You could use this instead:

If Len(Dir$("D:\temp\alex\", vbDirectory)) Then

and

If Len(Dir$("D:\temp\", vbDirectory)) Then


These statements should return True if the folders exist and False if they
don't exist.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Alex St-Pierre wrote:
Hello,
The Dir function doesn't work all the time
example:
If Dir("D:\temp\alex\") = "" Then
exit sub
endif
the macro doesn't stop because the repertory is valid

and then, I try:
If Dir("D:\temp\") = "" Then
exit sub
endif
and the macro stop ?

It's very strange, the drive used is a server drive but always
available.

Finally, I tried:
path = "D:\temp\"
ChDrive path
ChDir path
If Dir(path) = "" Then
exit sub
endif
ChDrive and ChDir change but the macro stop ??
Any idea ?
Thanks,


 
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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
problem with Linking workbooks via "copy" and "paste link" Arkitek Excel Discussion (Misc queries) 0 December 19th 06 10:03 PM
Drawing Diagonal Lines "Refresh" problem - Any suggestions Marc Excel Discussion (Misc queries) 1 September 7th 06 03:52 AM
Problem with "On error resume next" with "custom VLookup" Factivator Excel Programming 3 July 20th 04 04:42 PM


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