-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModule1.bas
28 lines (21 loc) · 849 Bytes
/
Module1.bas
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
Attribute VB_Name = "Module1"
'Module1: Switch On/Off the Macro by pressing {F12}
Global macroEnabled As Boolean
Sub enableMacro()
macroEnabled = Not macroEnabled
If macroEnabled Then Call KotobaOboeru.registerKeyStrokes
Dim oldStatusBar
oldStatusBar = Application.DisplayStatusBar
Application.DisplayStatusBar = True
If macroEnabled Then
Call KotobaOboeru.initColor(RGB(250, 249, 246))
Application.StatusBar = "Macro is ON! Rendering worksheet..."
Else
Call KotobaOboeru.initColor(RGB(0, 0, 0))
Application.StatusBar = "Macro is OFF, Restoring worksheet..."
End If
Debug.Print "Macro ON? : " & CStr(macroEnabled)
Application.Wait (Now + TimeValue("0:00:02"))
Application.StatusBar = False
Application.DisplayStatusBar = oldStatusBar
End Sub