Skip to content

Commit 1528be3

Browse files
committed
add new tools
new tools upper and lower case
1 parent e992516 commit 1528be3

35 files changed

+398
-335
lines changed

Addin_MacroTools_ENG.xlsb

-874 Bytes
Binary file not shown.

Addin_MacroTools_RUS.xlsb

1.11 KB
Binary file not shown.

scripts/Class_Modules/VBECommandHandler.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Private Sub EvtHandler_Click(ByVal Ctrl As CommandBarButton, CancelDefault As Bo
2525
16: Exit Sub
2626
ErrorHandler:
2727
18: If Err.Number <> 0 Then
28-
19: Debug.Print "Error in Eventhandler_Click" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line" & Erl
28+
19: Debug.Print "Error in Eventhandler_Click" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line " & Erl
2929
20: Call WriteErrorLog("EvtHandler_Click")
3030
21: Err.Clear
3131
22: Resume Next

scripts/Modules/A_RibbonCallbacks.bas

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ Option Explicit
2828
Private Sub RefrasBtn(ByRef control As IRibbonControl)
2929
28: If VBAIsTrusted Then
3030
29: Call B_CreateMenus.RefreshMenu
31-
30: Else
32-
31: Call MsgBox(C_Const.sMSGVBA1, vbCritical, C_Const.sMSGVBA2)
3331
32: End If
3432
33: End Sub
3533
Private Sub ImportCodeBaseBtn(ByRef control As IRibbonControl)
@@ -46,7 +44,7 @@ ErrorHandler:
4644
Case 91:
4745
46: Call MsgBox("No open files" & Chr(34) & "Excel files" & Chr(34) & "!", vbOKOnly + vbExclamation, "Error:")
4846
47: Case Else:
49-
48: Call MsgBox("Error in ImportCodeBaseBtn" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line" & Erl, vbOKOnly + vbExclamation, "Error:")
47+
48: Call MsgBox("Error in ImportCodeBaseBtn" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line " & Erl, vbOKOnly + vbExclamation, "Error:")
5048
49: Call WriteErrorLog("ImportCodeBaseBtn")
5149
50: End Select
5250
51: Err.Clear
@@ -117,7 +115,7 @@ ErrorHandler:
117115
Case 91:
118116
117: Call MsgBox("No open files" & Chr(34) & "Excel files" & Chr(34) & "!", vbOKOnly + vbExclamation, "Error:")
119117
118: Case Else:
120-
119: Call MsgBox("Error in onUnProtectSheets" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line" & Erl, vbOKOnly + vbExclamation, "Error:")
118+
119: Call MsgBox("Error in onUnProtectSheets" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line " & Erl, vbOKOnly + vbExclamation, "Error:")
121119
120: Call WriteErrorLog("onUnUnProtectSheets")
122120
121: End Select
123121
122: Err.Clear

scripts/Modules/B_CreateMenus.bas

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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)
8387
End Sub
8488
Private 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
206214
ErrorHandler:
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
211219
End Sub
212220
Public 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
216226
ErrorHandler:
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
266277
Public 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 & ":")
270281
End Sub
271282
Private Sub subMsgBoxGenerator()
272283
MsgBoxGenerator.Show

scripts/Modules/C_Const.bas

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ Public Const RTAG1 As String = NAME_ADDIN & "_VBE_RENAME_TAG1"
102102
Public Const RTAG2 As String = NAME_ADDIN & "_VBE_RENAME_TAG2"
103103
Public Const RTAG3 As String = NAME_ADDIN & "_VBE_RENAME_TAG3"
104104
Public Const RTAG4 As String = NAME_ADDIN & "_VBE_RENAME_TAG4"
105+
Public Const RTAG5 As String = NAME_ADDIN & "_VBE_RENAME_TAG5"
106+
Public Const RTAG6 As String = NAME_ADDIN & "_VBE_RENAME_TAG6"
105107

106108
Public Const POPMENU As String = "Code Window"
107109
Public Const TOOLSMENU As String = NAME_ADDIN & " ToolBar"

scripts/Modules/C_PublicFunctions.bas

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,16 +434,16 @@ ErrorHandler:
434434
'* ByVal sTxt As String :
435435
'*
436436
'* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
437-
Public Function TrimSpace(ByVal stxt As String) As String
437+
Public Function TrimSpace(ByVal sTxt As String) As String
438438
297: Dim sTemp As String
439439
298: Const LENGHT_CELLS As Long = 32767
440-
299: sTemp = stxt
440+
299: sTemp = sTxt
441441
300: If VBA.Len(sTemp) <= LENGHT_CELLS Then
442442
301: sTemp = Application.WorksheetFunction.Trim(sTemp)
443443
302: Else
444444
303: Dim i As Long
445-
304: For i = 1 To VBA.Len(stxt) Step LENGHT_CELLS
446-
305: sTemp = sTemp & Application.WorksheetFunction.Trim(VBA.Mid$(stxt, i, LENGHT_CELLS))
445+
304: For i = 1 To VBA.Len(sTxt) Step LENGHT_CELLS
446+
305: sTemp = sTemp & Application.WorksheetFunction.Trim(VBA.Mid$(sTxt, i, LENGHT_CELLS))
447447
306: Next i
448448
307: End If
449449
308: TrimSpace = sTemp

scripts/Modules/D_OnAction.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ errmsg:
5151
50: If Err.Number = 91 Then
5252
51: Debug.Print "Snippet not found, selected:" & str_search
5353
52: Else
54-
53: Debug.Print "Error in Insert Code!" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line" & Erl
54+
53: Debug.Print "Error in Insert Code!" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line " & Erl
5555
54: Call WriteErrorLog("InsertCode")
5656
55: End If
5757
56: Err.Clear

scripts/Modules/E_AddEnum.bas

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ errmsg:
9292
52: Case 76:
9393
53: Debug.Print "Module: [" & VBName & "] added to the book:" & ActiveWorkbook.Name & vbLf & "The file is not saved!"
9494
54: Case Else:
95-
55: Debug.Print "Error in Add Module To Project" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line" & Erl
95+
55: Debug.Print "Error in Add Module To Project" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line " & Erl
9696
56: Call WriteErrorLog("AddModuleToProject")
9797
57: End Select
9898
58: End Sub
@@ -171,7 +171,7 @@ ErrorHandler:
171171
131: Case 76:
172172
132: Debug.Print "Module: [" & VBName & "] has been removed, from the workbook:" & ActiveWorkbook.Name & vbLf & "The file is not saved!"
173173
133: Case Else:
174-
134: Debug.Print "Error in Delete Module To Project" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line" & Erl
174+
134: Debug.Print "Error in Delete Module To Project" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line " & Erl
175175
135: Call WriteErrorLog("DeleteModuleToProject")
176176
136: End Select
177177
137: Err.Clear
@@ -189,7 +189,7 @@ ErrorHandler:
189189
Case 76:
190190
150: AddFileName = ActiveWorkbook.Name
191191
151: Case Else:
192-
152: Debug.Print "Error in Add FileName" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line" & Erl
192+
152: Debug.Print "Error in Add FileName" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line " & Erl
193193
153: Call WriteErrorLog("AddFileName")
194194
154: End Select
195195
155: Err.Clear
@@ -249,7 +249,7 @@ ErrorHandler:
249249
Case 76:
250250
210: Call MsgBox("The file is not saved, save the file!", vbCritical, "Error:")
251251
211: Case Else:
252-
212: Debug.Print "Error in Copy Module Form" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line" & Erl
252+
212: Debug.Print "Error in Copy Module Form" & vbLf & Err.Number & vbLf & Err.Description & vbCrLf & "in the line " & Erl
253253
213: Call WriteErrorLog("CopyModuleForm")
254254
214: End Select
255255
215: Err.Clear

scripts/Modules/F_AddInInstall.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ InstallationAdd_Err:
4949
47: MsgBox "To install the add-in, please close this file and run it again.", _
5050
64, "Installation"
5151
49: Else
52-
50: MsgBox Err.Description & vbCrLf & "â F_AddInInstall.InstallationAdd " & vbCrLf & "in the line" & Erl, vbExclamation + vbOKOnly, "Error:"
52+
50: MsgBox Err.Description & vbCrLf & "â F_AddInInstall.InstallationAdd " & vbCrLf & "in the line " & Erl, vbExclamation + vbOKOnly, "Error:"
5353
51: Call WriteErrorLog("F_AddInInstall.InstallationAdd")
5454
52: End If
5555
53: End Sub

0 commit comments

Comments
 (0)