-
Notifications
You must be signed in to change notification settings - Fork 1
/
mActAdHoc.bas
144 lines (112 loc) · 3.12 KB
/
mActAdHoc.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
Attribute VB_Name = "mActAdHoc"
Sub p_in2plnPivot(ByVal vIRibbonControl As IRibbonControl)
Dim namelist As Variant
Dim vallist As Variant
On Error GoTo ErrorHandler
Call p_CheckConnection
Call p_setExcelCalcOff
X = HypMenuVPivot()
If X = 0 Then
vIsSVEnabled = False
X = HypSetMenu(vIsSVEnabled)
Else
If vIsSVEnabled Then
SendKeys "%y3y1"
SendKeys "%YQAYQW"
DoEvents
vIsSVEnabled = False
X = HypSetMenu(vIsSVEnabled)
isHypShowPov = True
X = HypShowPov(isHypShowPov)
Else
vIsSVEnabled = True
X = HypSetMenu(vIsSVEnabled)
isHypShowPov = True
X = HypShowPov(isHypShowPov)
End If
End If
Call p_setExcelCalcOn
l_exit:
Exit Sub
ErrorHandler:
Call p_ErrorHandler(X, "p_in2plnPivot")
End Sub
Sub p_in2plnZoomOut(ByVal vIRibbonControl As IRibbonControl)
On Error GoTo ErrorHandler
Call p_CheckConnection
Call p_setExcelCalcOff
X = HypMenuVZoomOut()
If X <> 0 Then GoTo ErrorHandler
X = HypShowPov(isHypShowPov)
Call p_setExcelCalcOn
l_exit:
Exit Sub
ErrorHandler:
Call p_ErrorHandler(X, "p_in2plnZoomOut")
X = 0
End Sub
Sub p_in2plnZoomIn(ByVal vIRibbonControl As IRibbonControl)
On Error GoTo ErrorHandler
Call p_CheckConnection
Call p_setExcelCalcOff
X = HypMenuVZoomIn()
If X <> 0 Then GoTo ErrorHandler
X = HypShowPov(isHypShowPov)
Call p_setExcelCalcOn
l_exit:
Exit Sub
ErrorHandler:
Call p_ErrorHandler(X, "p_in2plnZoomIn")
X = 0
End Sub
Sub p_in2plnKeepOnly(ByVal vIRibbonControl As IRibbonControl)
On Error GoTo ErrorHandler
Call p_CheckConnection
Call p_setExcelCalcOff
X = HypMenuVKeepOnly()
If X <> 0 Then GoTo ErrorHandler
X = HypShowPov(isHypShowPov)
Call p_setExcelCalcOn
l_exit:
Exit Sub
ErrorHandler:
Call p_ErrorHandler(X, "p_in2plnKeepOnly")
X = 0
End Sub
Sub p_in2plnRemoveOnly(ByVal vIRibbonControl As IRibbonControl)
On Error GoTo ErrorHandler
Call p_CheckConnection
Call p_setExcelCalcOff
X = HypMenuVRemoveOnly()
If X <> 0 Then GoTo ErrorHandler
X = HypShowPov(isHypShowPov)
X = 0
Call p_setExcelCalcOn
l_exit:
Exit Sub
ErrorHandler:
Call p_ErrorHandler(X, "p_in2plnRemoveOnly")
X = 0
End Sub
Sub p_in2plnMemberSelect(ByVal vIRibbonControl As IRibbonControl)
On Error GoTo ErrorHandler
Call p_CheckConnection
Call p_setExcelCalcOff
Application.EnableCancelKey = xlErrorHandler
X = HypMenuVMemberSelection()
Application.EnableCancelKey = xlInterrupt
If X <> 0 Then GoTo ErrorHandler
Call p_setExcelCalcOn
l_exit:
Exit Sub
ErrorHandler:
Call p_ErrorHandler(X, "p_in2plnMemberSelect")
End Sub
Sub p_in2plnAttributes(ByVal vIRibbonControl As IRibbonControl)
On Error GoTo ErrorHandler
Call p_execSVMenu("Planning Ad Hoc->Insert Attributes")
l_exit:
Exit Sub
ErrorHandler:
Call p_ErrorHandler(X, "p_in2plnAttributes")
End Sub