@@ -75,11 +75,15 @@ Public Sub AddContextMenus()
7575 Call AddButtom (C_Const.RTAG1, 162 , "ReName Control" , "RenameControl" , C_Const.RENAMEMENU, True )
7676 Call AddButtom (C_Const.RTAG2, 22 , "Paste Style" , "PasteStyleControl" , C_Const.RENAMEMENU, True )
7777 Call AddButtom (C_Const.RTAG3, 1076 , "Copy Style" , "CopyStyleControl" , C_Const.RENAMEMENU, True )
78- Call AddButtom (C_Const.RTAG4, 704 , "Paste Icon" , "AddIcon" , C_Const.RENAMEMENU, True , True )
78+ Call AddButtom (C_Const.RTAG5, 0 , "UPPER Case" , "UperTextInControl" , C_Const.RENAMEMENU, True , False )
79+ Call AddButtom (C_Const.RTAG6, 0 , "lower Case" , "LowerTextInControl" , C_Const.RENAMEMENU, True , False )
80+
7981 Call AddButtom (C_Const.CTAG1, 2045 , "Copy Module" , "CopyModyleVBE" , C_Const.COPYMODULE, True , False )
8082
8183 Call AddButtom (C_Const.RTAG2, 22 , "Paste Style" , "PasteStyleControl" , C_Const.mMSFORMS, True )
8284 Call AddButtom (C_Const.RTAG3, 1076 , "Copy Style" , "CopyStyleControl" , C_Const.mMSFORMS, True )
85+ Call AddButtom (C_Const.RTAG5, 0 , "UPPER Case" , "UperTextInForm" , C_Const.mMSFORMS, True , False )
86+ Call AddButtom (C_Const.RTAG6, 0 , "lower Case" , "LowerTextInForm" , C_Const.mMSFORMS, True , False )
8387End Sub
8488Private Sub AddNewCommandBarMenu (ByVal sNameCommandBar As String )
8589 Dim myCommandBar As CommandBar
@@ -160,9 +164,13 @@ Public Sub DeleteContextMenus()
160164 Call DeleteButton (C_Const.RTAG2, C_Const.RENAMEMENU)
161165 Call DeleteButton (C_Const.RTAG3, C_Const.RENAMEMENU)
162166 Call DeleteButton (C_Const.RTAG4, C_Const.RENAMEMENU)
167+ Call DeleteButton (C_Const.RTAG5, C_Const.RENAMEMENU)
168+ Call DeleteButton (C_Const.RTAG6, C_Const.RENAMEMENU)
163169
164170 Call DeleteButton (C_Const.RTAG2, C_Const.mMSFORMS)
165171 Call DeleteButton (C_Const.RTAG3, C_Const.mMSFORMS)
172+ Call DeleteButton (C_Const.RTAG5, C_Const.mMSFORMS)
173+ Call DeleteButton (C_Const.RTAG6, C_Const.mMSFORMS)
166174
167175 Set myCommandBar = Application.VBE.CommandBars(C_Const.TOOLSMENU)
168176 If Not myCommandBar Is Nothing Then
@@ -186,7 +194,7 @@ ErrorHandler:
186194 Case 5 :
187195 Err.Clear
188196 Case Else :
189- Debug.Print "Error in DeleteContextMenus" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line" & Erl
197+ Debug.Print "Error in DeleteContextMenus" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line " & Erl
190198 Call WriteErrorLog ("DeleteContextMenus" )
191199 End Select
192200 Err.Clear
@@ -204,24 +212,27 @@ Private Sub DeleteButton(ByRef sTag As String, ByVal sMenu As String)
204212 Next Ctrl
205213 Exit Sub
206214ErrorHandler:
207- Debug.Print "Error in DeleteButton" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line" & Erl
215+ Debug.Print "Error in DeleteButton" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line " & Erl
208216 Call WriteErrorLog ("DeleteButton" )
209217 Err.Clear
210218 Resume Next
211219End Sub
212220Public Function VBAIsTrusted () As Boolean
213221 On Error GoTo ErrorHandler
222+ Dim sTxt As String
223+ sTxt = Application.VBE.Version
214224 VBAIsTrusted = True
215225 Exit Function
216226ErrorHandler:
217227 Select Case Err.Number
218228 Case 1004 :
219- If ThisWorkbook.Name = C_Const.NAME_ADDIN & ".xlam" Then Call MsgBox ("Warning!" & C_Const.NAME_ADDIN & vbLf & vbNewLine & _
229+ 'If ThisWorkbook.Name = C_Const.NAME_ADDIN & ".xlam" Then
230+ Call MsgBox ("Warning! " & C_Const.NAME_ADDIN & vbLf & vbNewLine & _
220231 "Disabled: [Trust access to the VBA object model]" & vbLf & _
221232 "To enable it, go to: File->Settings->Security Management Center->Macro Settings" & _
222233 vbLf & vbNewLine & "And restart Excel" , vbCritical, "Warning:" )
223234 Case Else :
224- Debug.Print "Error! in VBA, isTrusted" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line" & Erl
235+ Debug.Print "Error! in VBA, isTrusted" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line " & Erl
225236 Call WriteErrorLog ("VBAIsTrusted" )
226237 End Select
227238 Err.Clear
@@ -266,7 +277,7 @@ End Sub
266277Public Sub RefreshMenu ()
267278 Call B_CreateMenus .DeleteContextMenus
268279 Call B_CreateMenus .AddContextMenus
269- Call MsgBox ("The add" & C_Const.NAME_ADDIN & "-in was rebooted!" , vbInformation, "The add" & C_Const.NAME_ADDIN & ":" )
280+ Call MsgBox ("The add-in " & C_Const.NAME_ADDIN & " - was rebooted!" , vbInformation, "The add" & C_Const.NAME_ADDIN & ":" )
270281End Sub
271282Private Sub subMsgBoxGenerator ()
272283 MsgBoxGenerator.Show
0 commit comments