+ Reply to Thread
Results 1 to 3 of 3

Quick question on multitasking

  1. #1
    Registered User
    Join Date
    03-11-2005
    Posts
    87

    Quick question on multitasking

    I have a Worksheet Calculate code that does several things into the same sheet. However when two different events get triggered at the same time Excel cannot handle it - and have an error message sending me back to VB. Would it solve the problem to have part of the code in a Worksheet Calculate of a different worksheet so to therfore have both events triggered at the same time?

    Many thanks

    BC

  2. #2
    Bill Martin
    Guest

    Re: Quick question on multitasking

    bondcrash wrote:
    > I have a Worksheet Calculate code that does several things into the same
    > sheet. However when two different events get triggered at the same time
    > Excel cannot handle it - and have an error message sending me back to
    > VB. Would it solve the problem to have part of the code in a Worksheet
    > Calculate of a different worksheet so to therfore have both events
    > triggered at the same time?
    >
    > Many thanks
    >
    > BC



    I *assume* that you're using an event handler which contains code fragments
    similar to:

    Private Sub Name(ByVal Target as Excel.Range)

    Application.EnableEvents = False
    Various bits of VBA to handle the event and call some Macro
    Application.EnableEvents = True

    End Sub

    If so, I would have thought the second event could not be invoked until the
    first one finished and re-enabled the system...?

    Or are you using a different approach of some kind?

    Bill


  3. #3
    Registered User
    Join Date
    03-11-2005
    Posts
    87
    Thanks Bill - basically my code triggers some actions when some other cells either get a value or change an existing value - but the trigger is not done manually by me by inputting a value to a cell for example but is a result of the sheet recalculations. the problem is a couple of things can clash with each other and excel doesnt manage to execute one if the other is being executed at the same time - and if it misses it doesnt re-execute later as the the event triggering is now gone.
    I have tried to split from the code the bit that can clash with something else and put into a different worksheet in the same workbook - not sure it will work but have no way to know till will be triggered next time.

    Best

    BC

+ 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