Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dir() command problems

Status
Not open for further replies.

lstephane

Programmer
Nov 19, 2002
35
CA
Hi,

I'm trying to validate if a specific file exists in a specific directory but VB return an error due to a space into my path string.

I tryied to force chr(34) before and after the string, but still returing error.

Can any body have a clue on this issue ?

Thanks !

Stéphane Lambert, Analyst/Programmer - BI Specialist
Info Quest (IQ), Data Warehouse System
McKesson Canada Corporation

EMail: stephane.lambert@mckesson.ca
 
What OS are you using? XP works fine with spaces in pathname:

Debug.Print Dir("c:\program files\visio\f*.*")

Produces:
Filelist Ent.wri

Otherwise you may have to use the FileExists function in FSO

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Try using DOS no-more-than-8.3 notataion, e.g.
Code:
Debug.Print Dir("c:\progra~1\visio\f*.*")

----------------------------------------

Crystalinity
      |
     /|  _/_|_\_         Pure
   \ | /          Silicon
    \|/           Data
     |
 
FirstAidMan

Did any of the suggestions work for you? If not, could you please answer the questions so we can move on. It would be really helpful to us all if we knew if this was closed or not.

Read faq222-2244, especially paragraph 15

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top