Processbook crashing kernelbase.dll

Discussion created by daviessj on Dec 10, 2014
Latest reply on Dec 10, 2014 by Marcos Vainer Loeff
I hope I am posting this in the right place. I've encountered an interesting problem with some Processbook VBA code I wrote some time ago.  The idea of the code is to animate a group of wind turbines when they are generating to give a visual representation of their status.  Unfortunately the code to do this eventually crashes Processbook with the error below.  Kernelbase.dll is a system file, so I have no idea how or why my code is causing it a problem.  From searching the web it looks like the way to fix this problem with other applications is to reinstall them, however this hasn't helped.  This is also occurring on at least two different machines so a corrupted install seems unlikely.  Other suggestions to investigate the problem involve running the application in Windows Safe Mode, however Processbook and the PI services don't appear to work in Safe Mode.  I have included the problematic code below (it is specifically the bit in the While loop that is causing the problem) to see if anyone can see any obvious mistakes in my code. The problem does not appear to be due memory leakage as during the time that the code is active Processbook doesn't go above using 70MB of memory.   Stopped working Problem signature:   Problem Event Name:     APPCRASH   Application Name:     Procbook.exe   Application Version:   Application Timestamp:     4a978510   Fault Module Name:     KERNELBASE.dll   Fault Module Version:     6.1.7601.18409   Fault Module Timestamp:     53159a86   Exception Code:     e053534f   Exception Offset:     0000c42d   OS Version:     6.1.7601.   Locale ID:     2057 Private Sub Display_DataUpdate() '     'ThisDisplay.Zoom = "FitAll"     Dim i As Long     Dim res As Variant 'Double     Dim vrDate As Variant     Dim vrStatus As Variant     Dim totalTurbinesRunning As Integer     'Dim PiDate As PITimeFormat     Dim PIStatus As Integer         '     i = 0     While bRunning = True     '         totalTurbinesRunning = 0                 'DoEvents         res = tbn1.GetValue(vrDate, vrStatus)         If res > 0 Then             ThisDisplay.Symbols.Item("Composite1").Rotation = i             totalTurbinesRunning = totalTurbinesRunning + 1         End If                 res = tbn2.GetValue(vrDate, vrStatus)         If res > 0 Then             ThisDisplay.Symbols.Item("Composite52").Rotation = i             totalTurbinesRunning = totalTurbinesRunning + 1         End If                 res = tbn3.GetValue(vrDate, vrStatus)         If res > 0 Then             ThisDisplay.Symbols.Item("Composite21").Rotation = i             totalTurbinesRunning = totalTurbinesRunning + 1         End If                 res = tbn4.GetValue(vrDate, vrStatus)         If res > 0 Then             ThisDisplay.Symbols.Item("Composite10").Rotation = i             totalTurbinesRunning = totalTurbinesRunning + 1         End If                 res = tbn5.GetValue(vrDate, vrStatus)         If res > 0 Then             ThisDisplay.Symbols.Item("Composite3").Rotation = i             totalTurbinesRunning = totalTurbinesRunning + 1         End If         DoEvents         '         Sleep (55)         i = i - 9                   ' 9         If i