Skip to content

Commit 4c34755

Browse files
committed
choose better names
1 parent 8b3c0d9 commit 4c34755

File tree

6 files changed

+17
-18
lines changed

6 files changed

+17
-18
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
vbaDeveloper.xlam
1+
/vbaDeveloper.xlam

src/vbaDeveloper.xlam/Build.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Attribute VB_Name = "Build"
1717
' 10.If necessary rename module 'Build1' to Build. Menu File-->Save vbaDeveloper.xlam
1818
'''
1919

20-
20+
Option Explicit
2121

2222
Public Sub testImport()
2323
Dim proj_name As String

src/vbaDeveloper.xlam/ErrorHandling.bas

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ End Sub
1212
Public Sub handleError(Optional errLocation As String = "")
1313
Dim errorMessage As String
1414
errorMessage = "Error in " & errLocation & ", [" & Err.Source & "] : error number " & Err.Number & vbNewLine & Err.Description
15-
debugPrint errorMessage
15+
Debug.Print errorMessage
1616
MsgBox errorMessage, vbCritical, "vbaDeveloper ErrorHandler"
1717
End Sub
1818

19-
20-
Public Sub debugPrint(message As String)
21-
Debug.Print message
22-
End Sub

src/vbaDeveloper.xlam/CExcelEvents.cls renamed to src/vbaDeveloper.xlam/EventListener.cls

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ VERSION 1.0 CLASS
22
BEGIN
33
MultiUse = -1 'True
44
END
5-
Attribute VB_Name = "CExcelEvents"
5+
Attribute VB_Name = "EventListener"
66
Attribute VB_GlobalNameSpace = False
77
Attribute VB_Creatable = False
88
Attribute VB_PredeclaredId = False
99
Attribute VB_Exposed = False
1010
'This class receives and acts upon events from the excel application.
11+
12+
Option Explicit
13+
1114
Private WithEvents App As Application
1215
Attribute App.VB_VarHelpID = -1
1316

@@ -30,7 +33,7 @@ Private Sub App_WorkbookAfterSave(ByVal wb As Workbook, ByVal success As Boolean
3033
On Error GoTo 0
3134
Exit Sub
3235
App_WorkbookAfterSave_Error:
33-
ErrorHandling.handleError "vbaDeveloper.CExcelEvents afterSave"
36+
ErrorHandling.handleError "vbaDeveloper.EventListener afterSave"
3437
End Sub
3538

3639
Private Sub App_WorkbookBeforeSave(ByVal wb As Workbook, ByVal SaveAsUI As Boolean, Cancel As Boolean)
@@ -39,19 +42,18 @@ End Sub
3942

4043
Private Sub App_WorkbookOpen(ByVal wb As Workbook)
4144
On Error GoTo App_WorkbookOpen_Error
42-
debugPrint "vbaDeveloper CExcelEvents App_WorkbookOpen()"
4345

4446
'Import all the modules for this workbook
4547
Dim importNow As Integer
46-
importNow = MsgBox("Import the code for " & wb.name & " now?", vbYesNo, "CExcelEvents Workbook open EVENT")
48+
importNow = MsgBox("Import the code for " & wb.name & " now?", vbYesNo, "EventListener Workbook open event")
4749
If importNow = vbYes Then
4850
Build.importVbaCode wb.VBProject
4951
End If
5052

5153
On Error GoTo 0
5254
Exit Sub
5355
App_WorkbookOpen_Error:
54-
ErrorHandling.handleError "vbaDeveloper.CExcelEvents WorkbookOpen"
56+
ErrorHandling.handleError "vbaDeveloper.EventListener WorkbookOpen"
5557
End Sub
5658

5759
Private Sub Class_Terminate()

src/vbaDeveloper.xlam/Test.bas

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Public Sub testMyCustomActions_Open()
88
End Sub
99

1010

11-
1211
Public Sub testImport()
1312
Dim proj_name As String
1413
proj_name = "vbaDeveloper"

src/vbaDeveloper.xlam/ThisWorkbook.sheet.cls

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
Private eventListener As CExcelEvents
1+
Option Explicit
2+
3+
Private listener As EventListener
24
Private customAction As CustomActions
35

46
' Initialize member to listen to excel events
57
Private Sub Workbook_Open()
6-
debugPrint "vbaDeveloper thisWorkbook_open()"
7-
Set eventListener = New CExcelEvents
8+
Debug.Print "vbaDeveloper thisWorkbook_open()"
9+
Set listener = New EventListener
810
Set customAction = New MyCustomActions
911
customAction.afterOpen
1012
End Sub
1113

1214
' Clean up our private members
1315
Private Sub Workbook_BeforeClose(Cancel As Boolean)
14-
debugPrint "vbaDeveloper thisWorkbook_BeforeClose()"
16+
Debug.Print "vbaDeveloper thisWorkbook_BeforeClose()"
1517
customAction.beforeClose
1618
Set customAction = Nothing
17-
Set eventListener = Nothing
19+
Set listener = Nothing
1820
End Sub
1921

2022

0 commit comments

Comments
 (0)