ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Quick question on multitasking (https://www.excelbanter.com/excel-programming/339931-quick-question-multitasking.html)

bondcrash[_9_]

Quick question on multitasking
 

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

Many thanks

B

--
bondcras
-----------------------------------------------------------------------
bondcrash's Profile: http://www.excelforum.com/member.php...fo&userid=2099
View this thread: http://www.excelforum.com/showthread.php?threadid=46716


Bill Martin[_2_]

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


bondcrash[_10_]

Quick question on multitasking
 

Thanks Bill - basically my code triggers some actions when some othe
cells either get a value or change an existing value - but the trigge
is not done manually by me by inputting a value to a cell for exampl
but is a result of the sheet recalculations. the problem is a couple o
things can clash with each other and excel doesnt manage to execute on
if the other is being executed at the same time - and if it misses i
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 wit
something else and put into a different worksheet in the same workboo
- not sure it will work but have no way to know till will be triggere
next time.

Best

B

--
bondcras
-----------------------------------------------------------------------
bondcrash's Profile: http://www.excelforum.com/member.php...fo&userid=2099
View this thread: http://www.excelforum.com/showthread.php?threadid=46716



All times are GMT +1. The time now is 10:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com