+ Reply to Thread
Results 1 to 4 of 4

disable events does not work

  1. #1
    Mika
    Guest

    disable events does not work

    Hi,

    I have several public functions in the workbook I am working with, that
    are activated or executed whenever I make changes in the worksheets
    trough VBA. Although that is not a problem, it is not a good thing as
    it is slowing the execution of the VBA code.

    My guess is that the changes of the VBA codes into the worksheets,
    clear cells, etc, trigger worksheets changes events.

    At the beginning of the VBA code I already used:
    application.EnableEvents=False to avoid those unnecessary calls to the
    public functions but it does not work.

    what am I missing ?


  2. #2
    Dave Peterson
    Guest

    Re: disable events does not work

    Maybe it's not the events firing that is slowing down your macro.

    Maybe it's the recalculating after each change.

    Turn calculation to manual
    do your stuff
    turn calculation back to what it was before.

    Mika wrote:
    >
    > Hi,
    >
    > I have several public functions in the workbook I am working with, that
    > are activated or executed whenever I make changes in the worksheets
    > trough VBA. Although that is not a problem, it is not a good thing as
    > it is slowing the execution of the VBA code.
    >
    > My guess is that the changes of the VBA codes into the worksheets,
    > clear cells, etc, trigger worksheets changes events.
    >
    > At the beginning of the VBA code I already used:
    > application.EnableEvents=False to avoid those unnecessary calls to the
    > public functions but it does not work.
    >
    > what am I missing ?


    --

    Dave Peterson

  3. #3
    Mika
    Guest

    Re: disable events does not work

    Duh !!, of course thank you, that was the problem !!!. I wonder why the
    enable events doesn=B4t work thoug.


  4. #4
    Dave Peterson
    Guest

    Re: disable events does not work

    I bet disabling events did help (if you had events that would have fired). But
    not as much as the calculation stuff (in this case).

    Mika wrote:
    >
    > Duh !!, of course thank you, that was the problem !!!. I wonder why the
    > enable events doesn´t work thoug.


    --

    Dave Peterson

+ 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