Results 1 to 3 of 3

Thread: [RESOLVED] Absolutely bizarre workbook behavior

  1. #1

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Resolved [RESOLVED] Absolutely bizarre workbook behavior

    I deal with a workbook and the workbook I've linked to is, believe it or not, a cut down version of that workbook, and as is none of the buttons on sheet1 work. The file is large because of the formatting of sheet1 which extends all the way down to row 1048576, but that's not the problem I need help with.

    The problem is the 3 Public Functions in Module2. They don't get explicitly called from anywhere but bizarrely they do get called when Sheet1 is changed or a worksheet is added or deleted. To see it happen, place breakpoints on those 3 functions and execute the simple "test" macro that you'll find in Module1. You can follow this link https://www.mediafire.com/file/ggni5.../Demo.zip/file to MediaFire and download the workbook.

    Hopefully someone can tell me the cause.

  2. #2
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,443

    Re: Absolutely bizarre workbook behavior

    Quote Originally Posted by MartinLiss View Post
    The problem is the 3 Public Functions in Module2. To see it happen, place breakpoints on those 3 functions and execute the simple "test" macro that you'll find in Module1.
    Set Breakpoints in the 3 functions in module2, and ran "test"
    Cannot confirm!
    It's not entering the functions.
    Adding a sheet doesn't fire the code, but deleting it!

    At a guess: When deleting, your sheet becomes the active one.
    Do you have in Options something like "calculate sheet when it becomes active"?

    And you're wrong about "the functions not getting called anywhere":
    For instance: e.g. In Column GJ10 you have "=GetDouble(BF10)" with the other 2 functions also there in the following columns.
    That is "being called"

    Bottom line: Your sheet becomes active, it starts recalculating everything, incl. your custom functions
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  3. #3

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: Absolutely bizarre workbook behavior

    And you're wrong about "the functions not getting called anywhere":
    For instance: e.g. In Column GJ10 you have "=GetDouble(BF10)" with the other 2 functions also there in the following columns.
    I looked into this problem several times and it never occurred to me to check to see if those functions were being used as UDFs. Thank you!

Posting Permissions

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



Click Here to Expand Forum to Full Width