-
Notifications
You must be signed in to change notification settings - Fork 3
/
RibbonUIUpdater.cls
49 lines (40 loc) · 1.21 KB
/
RibbonUIUpdater.cls
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
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "RibbonUIUpdater"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Private Type THelper
XLApplication As Application
XLWorksheet As Worksheet
End Type
Private this As THelper
'@Ignore ProcedureNotUsed
Private Sub xlApplication_SheetActivate(ByVal ws As Object)
If TypeName(ws) = "Worksheet" Then
Set RibbonModifier.RibbonUpdater.XLWorksheet = ActiveSheet
Else
Set RibbonModifier.RibbonUpdater.XLWorksheet = Nothing
End If
RibbonModifier.SyncUIControls
End Sub
'@Ignore ParameterNotUsed, ProcedureNotUsed
Private Sub xlWorksheet_SelectionChange(ByVal Target As Range)
RibbonModifier.SyncUIControls
End Sub
Public Property Get XLApplication() As Application
Set XLApplication = this.XLApplication
End Property
Public Property Let XLApplication(ByVal app As Application)
Set this.XLApplication = app
End Property
Public Property Get XLWorksheet() As Worksheet
Set XLWorksheet = this.XLWorksheet
End Property
Public Property Let XLWorksheet(ByVal ws As Worksheet)
Set this.XLWorksheet = ws
End Property