ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   EnableEvents=False doesn't work? or does it? (https://www.excelbanter.com/excel-programming/332836-enableevents%3Dfalse-doesnt-work-does.html)

Intellihome[_30_]

EnableEvents=False doesn't work? or does it?
 

Hello again,

I still need a fix for EnableEvents method, right now I am using globa
variable to work around this problem, but it really slows the program.

Here is the code

Private Sub Worksheet_Deactivate()
If CStr(Sheets("Display").Range("A38").Value) = "Y" Then

Sheets("Display").Range("A38").Value = vbNullString
Application.CalculateFull
Application.ScreenUpdating = False
Application.EnableEvents = False '<<<< this is where it i
turned off
Application.Calculation = xlCalculationManual

If CStr(Sheets("Data Input").Range("C3").Value) < vbNullStrin
Then


With Sheets("Calculations")
.Range("B1").Value = 0
.Range("B153").Value = 1
.Range("B157").Value = 1
.Range("B158").Value = 1
End With

With Sheets("CustomCalculations")
.Range("B1").Value = 0
.Range("B153").Value = 1
End With

With Sheets("Display")
.Range("C4:IV41").ClearContents
.Range("A41:B297").ClearContents
.Range("B39").Value = "Y"


j = 1

.Application.Calculate '<<< this line triggers all events
and all event handling procedures in the workbook are being execute
here
....

the rest, I think, is not needed

Could some one tell me what the problem with it?
Any ideas are appreciated!
Thank you,
Iva

--
Intellihom
-----------------------------------------------------------------------
Intellihome's Profile: http://www.msusenet.com/member.php?userid=147
View this thread: http://www.msusenet.com/t-187056443



All times are GMT +1. The time now is 12:40 PM.

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