+ Reply to Thread
Results 1 to 7 of 7

UDF Fails when recalculation is initiated from a different workbook

  1. #1
    Forum Contributor
    Join Date
    08-05-2009
    Location
    Colorado Springs, CO
    MS-Off Ver
    Office 365
    Posts
    161

    UDF Fails when recalculation is initiated from a different workbook

    This is the code:
    Please Login or Register  to view this content.
    As long as I'm in the workbook where this function exists, it returns correct values. If I go to a different book and force a recalculation, then the function returns #VALUE!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: UDF Fails when recalculation is initiated from a different workbook

    How are you calling it from the other workbook?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    08-05-2009
    Location
    Colorado Springs, CO
    MS-Off Ver
    Office 365
    Posts
    161

    Re: UDF Fails when recalculation is initiated from a different workbook

    The other workbook does not use the UDF in any way, and the UDF does not refer to cells in the other workbook. The UDF is just in a single workbook.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: UDF Fails when recalculation is initiated from a different workbook

    Oh, I see, you have a UDF defined and used in one workbook, but when a different workbook, which has nothing to do with the UDF, is recalculated, the UDF returns #VALUE.

    I have never seen that problem. Is there anything unusual about either file? How are you forcing recalculation--hitting F9, or in code?

  5. #5
    Forum Contributor
    Join Date
    08-05-2009
    Location
    Colorado Springs, CO
    MS-Off Ver
    Office 365
    Posts
    161

    Re: UDF Fails when recalculation is initiated from a different workbook

    I changed this:
    Please Login or Register  to view this content.
    to this:
    Please Login or Register  to view this content.
    and that worked.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: UDF Fails when recalculation is initiated from a different workbook

    I strongly suggest you revisit your post from yesterday, read post #2 from MrShorty and then implement it. It will save you a lot of problems like this in the future.
    Everyone who confuses correlation and causation ends up dead.

  7. #7
    Forum Contributor
    Join Date
    08-05-2009
    Location
    Colorado Springs, CO
    MS-Off Ver
    Office 365
    Posts
    161

    Re: UDF Fails when recalculation is initiated from a different workbook

    Ordinarily, I would do as suggested, but this particular UDF has non obvious inputs which never change. Thanks for the help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. "Worksheet_Change" fails if change is initiated from another sheet
    By skipro in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-22-2017, 07:47 PM
  2. Force Recalculation of Workbook on change event
    By scribbler in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-15-2011, 08:33 AM
  3. Recalculation of Excel Workbook
    By kinrarateoh in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 11-26-2006, 09:50 PM
  4. Replies: 1
    Last Post: 03-01-2006, 02:20 PM
  5. Re : Excel Workbook Events Initiated by Cut-and-Paste Operations
    By tkt_tang@hotmail.com in forum Excel General
    Replies: 0
    Last Post: 01-31-2006, 03:30 AM
  6. Workbook level recalculation
    By Lavneet Singh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2005, 02:00 PM
  7. [SOLVED] Full recalculation when opening a workbook
    By Brian Hall in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-28-2005, 01:05 PM

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