+ Reply to Thread
Results 1 to 5 of 5

formula wont update

  1. #1
    Registered User
    Join Date
    10-24-2003
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    33

    formula wont update

    Hi,

    Somebody (forgot the name, sorry) on this forum gave me a formula to check if a filename exists:

    Function BookExists(wb As String)
    BookExists = Len(Dir(wb)) > 0
    End Function

    It worked fine however now I am using it in a different sheet were the filename is flexible like:

    =IF(BookExists(path&filename&"*.xls");TRUE;FALSE)

    were path is a named field and filename is a reference to a cell (like A20)

    It still works but only recalculates (checks if the file exists) when I edit the cell and press enter again. Just F9 won't work.

    Is there a way to make this formula recalculate by itself or recalculate by a macro?

    Thanks for your help.

    Arien de Haan

  2. #2
    Registered User
    Join Date
    10-24-2003
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    33
    That somebody must have been Bob Phillips...

  3. #3
    Kevin B
    Guest

    RE: formula wont update

    Add the following line to the custom formula:

    application.Volatile

    This will force the formula to recalc everytime the spreadsheet recalcs.

    Kevin Backmann


    "Arien" wrote:

    >
    > Hi,
    >
    > Somebody (forgot the name, sorry) on this forum gave me a formula to
    > check if a filename exists:
    >
    > Function BookExists(wb As String)
    > BookExists = Len(Dir(wb)) > 0
    > End Function
    >
    > It worked fine however now I am using it in a different sheet were the
    > filename is flexible like:
    >
    > =IF(BookExists(path&filename&"*.xls");TRUE;FALSE)
    >
    > were path is a named field and filename is a reference to a cell (like
    > A20)
    >
    > It still works but only recalculates (checks if the file exists) when I
    > edit the cell and press enter again. Just F9 won't work.
    >
    > Is there a way to make this formula recalculate by itself or
    > recalculate by a macro?
    >
    > Thanks for your help.
    >
    > Arien de Haan
    >
    >
    > --
    > Arien
    > ------------------------------------------------------------------------
    > Arien's Profile: http://www.excelforum.com/member.php...fo&userid=1892
    > View this thread: http://www.excelforum.com/showthread...hreadid=514849
    >
    >


  4. #4
    Registered User
    Join Date
    10-24-2003
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    33
    Kevin,

    Thanks for your help, but I am afraid it still does not update.

    I now made the formula:

    Function BookExists(wb As String)
    Application.Volatile
    BookExists = Len(Dir(wb)) > 0
    End Function

    Did I understand you correctly?

    I still have to edit the cell with the formule (F2) and press enter.

    regards,
    Arien

  5. #5
    Registered User
    Join Date
    10-24-2003
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    33
    Sorry my mistake. It does work now.

    Thanks a lot

    regards,
    Arien

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1