Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I check the file existis in local with a simple script for example if the file is in c:\my_dir\my:file.txt
    But if the file is in \\server_dir\my_file.txt the same code not work, why?
    have a tips.?

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post
    Sal

    Try this 2 part function

    Code:
    Function FileExist(fname) As Boolean
    	 If Dir(fname) <> "" Then _
     	 FileExist = True _
     	Else FileExist = False
    End Function
    '------------------------------------------------------------------------------------
    'The VBA code that uses the above function is as follows:
    Sub FindFile()
    
    strPath = "\\support\All\xml\code.xml"
     	FileStatus = FileExist(strPath)
     	If FileStatus <> True Then MsgBox "Does Not Exist"
    
    End Sub
    Jerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •