Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Checking for a linked file (Excel XP)

    I would like to check if a file is on a directory. At the moment I have link to an external file. Next to this link I would like a Yes/No indicator to see whether the file at the address as per the link

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Checking for a linked file (Excel XP)

    Others may have a better solution; I didn't see a way of using the formula containing the link - if the external file is open, the formula only contains the file name; if the file is closed, the formula contains the complete path.

    Put the following custom function in a standard module (if you want it to be available in all workbooks, put it in Personal.xls.)

    Public Function ExistsFile(sFile As String) As Boolean
    ExistsFile = Not (Dir(sFile) = "")
    End Function

    Use it in a cell in the form

    =ExistsFile("C:ExcelSomeFile.xls")

    If the function is in Personal.xls, this becomes

    =Personal.xls!ExistsFile("C:ExcelSomeFile.xls")

  3. #3
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Checking for a linked file (Excel XP)

    Thanks Hans

Posting Permissions

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