Results 1 to 2 of 2

Thread: Public Functions run for no apparent reason

  1. #1

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

    Public Functions run for no apparent reason

    I have 3 Public Functions in a workbook that run for no apparent reason. The declarations of the functions look like this:
    Code:
    Public Function MyFunction(v As String) As String
    They do not have Application.Volatile statements and they are not called by code. However if I do something like delete a sheet they are called. What's going on?

  2. #2

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

    Re: Public Functions run for no apparent reason

    As I was composing this question I thought "You dummy, why don't you see what Google has to say?" and as you might expect the answer is there and it's that Public functions are run anytime a recalc occurs as it does when a sheet is deleted, and apparently the only way to stop it is if you first set Application.Calculation = xlCalculationManual. That's a pian. Is there any other way?

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