-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathControlAutomaticProcessing.bas
More file actions
51 lines (39 loc) · 1.67 KB
/
Copy pathControlAutomaticProcessing.bas
File metadata and controls
51 lines (39 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Attribute VB_Name = "AutomaticProcessing"
Option Explicit
Private Const Module_Name As String = "AutomaticProcessing."
Public Sub TurnOffAutomaticProcessing()
' This routine turns off all the automatic processing that slows things down
Const RoutineName As String = Module_Name & "TurnOffAutomaticProcessing"
On Error GoTo ErrorHandler
Application.DisplayAlerts = False
Application.Calculation = xlManual
Application.EnableEvents = False
Application.ScreenUpdating = False
Done:
Exit Sub
ErrorHandler:
ReportError "Exception raised", _
"Routine", RoutineName, _
"Error Number", Err.Number, _
"Error Description", Err.Description
RaiseError Err.Number, Err.Source, RoutineName, Err.Description
End Sub ' TurnOffAutomaticProcessing
Public Sub TurnOnAutomaticProcessing()
' This routine turns on all the automatic processing that slows things down
' Reverses the things that were turned off in TurnOffAutomaticProcessing
Const RoutineName As String = Module_Name & "TurnOnAutomaticProcessing"
On Error GoTo ErrorHandler
Application.DisplayAlerts = True
Application.Calculation = xlAutomatic
Application.EnableEvents = True
Application.ScreenUpdating = True
Application.StatusBar = False
Done:
Exit Sub
ErrorHandler:
ReportError "Exception raised", _
"Routine", RoutineName, _
"Error Number", Err.Number, _
"Error Description", Err.Description
RaiseError Err.Number, Err.Source, RoutineName, Err.Description
End Sub ' TurnOnAutomaticProcessing