Skip to content

Commit

Permalink
Issue #9 closed and worked through RubberDuck reports to clean up a b…
Browse files Browse the repository at this point in the history
…it (#11)
  • Loading branch information
AronGahagan authored Mar 29, 2019
1 parent 89790d5 commit b5d816f
Show file tree
Hide file tree
Showing 25 changed files with 108 additions and 125 deletions.
1 change: 1 addition & 0 deletions Core/cptAbout_frm.frm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

'<cpt_version>v1.1.1</cpt_version>
Option Explicit
Private Const BLN_TRAP_ERRORS As Boolean = True
Expand Down
Binary file modified Core/cptAbout_frm.frx
Binary file not shown.
32 changes: 12 additions & 20 deletions Core/cptCore_bas.bas
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Sub cptStartEvents()
Set oMSPEvents = New cptEvents_cls
End Sub

Function cptSpeed(blnOn As Boolean)
Sub cptSpeed(blnOn As Boolean)

Application.ScreenUpdating = Not blnOn
Application.Calculation = pjAutomatic = Not blnOn

End Function
End Sub

Function cptGetUserForm(strModuleName As String) As UserForm
'objects
Expand Down Expand Up @@ -90,7 +90,6 @@ Dim vbComponent As Object, strVersion As String
strVersion = Replace(Replace(strVersion, "<cpt_version>", ""), "</cpt_version>", "")
cptGetVersions = cptGetVersions & vbComponent.Name & ": " & strVersion & vbCrLf
End If
next_component:
Next vbComponent

exit_here:
Expand Down Expand Up @@ -134,7 +133,7 @@ Dim strAbout As String

End Sub

Function cptReferenceExists(strReference) As Boolean
Function cptReferenceExists(strReference As String) As Boolean
'used to ensure a reference exists, returns boolean
Dim Ref As Object, blnExists As Boolean

Expand Down Expand Up @@ -229,7 +228,6 @@ End Sub
Function cptCheckReference(strReference As String) As Boolean
'this routine will be called ahead of any subroutine requiring a reference
'returns boolean and subroutine only proceeds if true
Dim blnExists As Boolean

On Error GoTo err_here

Expand Down Expand Up @@ -355,13 +353,13 @@ Dim arrCurrent As Object, arrInstalled As Object
Dim xmlDoc As Object, xmlNode As Object, xmlHttpDoc As Object, FindRecord As Object
Dim oStream As Object
'long
Dim lngItem As Long, lgCol As Long
Dim lngItem As Long
'strings
Dim strInstVer As String
Dim strCurVer As String
Dim strURL As String, strMsg As String, strVersion As String, strFileName As String
Dim strURL As String, strVersion As String
'booleans
Dim blnUpdatesAreAvailable As Boolean, blnLoaded As Boolean
Dim blnUpdatesAreAvailable As Boolean
'variants
Dim vCol As Variant

Expand Down Expand Up @@ -407,7 +405,6 @@ Dim vCol As Variant
strVersion = Replace(Replace(strVersion, "<cpt_version>", ""), "</cpt_version>", "")
arrInstalled.Add vbComponent.Name, strVersion
End If
next_component:
Next vbComponent

'populate the listbox header
Expand Down Expand Up @@ -475,7 +472,7 @@ End Sub

Sub cptSetReferences()
'this is a one-time shot to set all references currently required by the cp toolbar
Dim strDir As String, Ref As Object
Dim strDir As String

On Error Resume Next

Expand Down Expand Up @@ -528,7 +525,7 @@ Dim strDir As String, Ref As Object

End Sub

Sub cptHandleErr(strModule As String, strProcedure As String, err As ErrObject)
Sub cptHandleErr(strModule As String, strProcedure As String, objErr As ErrObject)
'common error handling prompt
Dim strMsg As String

Expand All @@ -553,7 +550,7 @@ Sub cptSubmitFeedback()
Application.OpenBrowser "https://forms.office.com/Pages/ResponsePage.aspx?id=Ro5H7jf1GEu_K_zo12S-I41LrliPQfRIoKdHTo6ZR7RUNERTVDRISUhVVVFSWjBBMlVLQThCRFlHQiQlQCN0PWcu"
End Sub

Function cptRemoveIllegalCharacters(ByVal strText As String) As String
Function cptRemoveIllegalCharacters(strText As String) As String
'written by Ryan Beard (RyanBeard@ClearPlanConsulting.com)
Const cstrIllegals As String = "\,/,:,*,?,"",<,>,|"

Expand All @@ -572,7 +569,6 @@ End Function

Sub cptWrapItUp()
'objects
Dim Tasks As Object
'strings
'longs
Dim lgLevel As Long
Expand Down Expand Up @@ -614,9 +610,9 @@ exit_here:
cptSpeed False
Exit Sub

no_tasks:
MsgBox "This project has no tasks to collapse.", vbExclamation + vbOKOnly, "WrapItUp"
GoTo exit_here
'no_tasks:
' MsgBox "This project has no tasks to collapse.", vbExclamation + vbOKOnly, "WrapItUp"
' GoTo exit_here

err_here:
Call cptHandleErr("cptCore_bas", "cptWrapItUp", err)
Expand Down Expand Up @@ -797,13 +793,9 @@ End Function
Function cptVersionStatus(strInstalled As String, strCurrent As String) As String
'objects
'strings
Dim strAction As String
'longs
Dim lngVersion As Long
Dim lngInstalled As Long
Dim lngCurrent As Long
'integers
Dim intLevel As Long
'booleans
'variants
Dim aCurrent As Variant
Expand Down
2 changes: 1 addition & 1 deletion Core/cptEvents_cls.cls
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Private Sub MyMSPApplication_WindowSelectionChange(ByVal Window As Window, ByVal
'objects
Dim ctl As Object
Dim frmText As Object 'UserForm
Dim Tasks As Tasks, Task As Task, Resources As Resources, Resource As Resource
Dim Tasks As Tasks, Task As Task, Resources As Resources
'strings
'longs
Dim lngItem As Long, lngItems As Long
Expand Down
1 change: 1 addition & 0 deletions Core/cptUpgrades_frm.frm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Attribute VB_Exposed = False




'<cpt_version>v1.2.1</cpt_version>
Option Explicit
Private Const BLN_TRAP_ERRORS As Boolean = True
Expand Down
Binary file modified Core/cptUpgrades_frm.frx
Binary file not shown.
2 changes: 1 addition & 1 deletion Count/cptCountTasks_bas.bas
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Dim Task As Task, Tasks As Tasks
Dim lgTasks As Long, lgSummary As Long, lgInactive As Long
Dim strMsg As String

On Error GoTo err_here
If BLN_TRAP_ERRORS Then On Error GoTo err_here Else On Error GoTo 0

'===
'Validate users selected view type
Expand Down
114 changes: 57 additions & 57 deletions CurrentVersions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,46 @@
<Directory>Core</Directory>
</Module>
<Module>
<Name>cptAbout_frm</Name>
<FileName>cptAbout_frm.frm</FileName>
<Version>v1.1.1</Version>
<Type>3</Type>
<Directory>Core</Directory>
<Name>cptSetup_bas</Name>
<FileName>cptSetup_bas.bas</FileName>
<Version>v1.2</Version>
<Type>1</Type>
<Directory></Directory>
</Module>
<Module>
<Name>cptBrowseFolder_bas</Name>
<FileName>cptBrowseFolder_bas.bas</FileName>
<Name>cptCountTasks_bas</Name>
<FileName>cptCountTasks_bas.bas</FileName>
<Version>v1.0.1</Version>
<Type>1</Type>
<Directory>Core</Directory>
<Directory>Count</Directory>
</Module>
<Module>
<Name>cptCore_bas</Name>
<FileName>cptCore_bas.bas</FileName>
<Version>v1.3.1</Version>
<Name>cptCriticalPath_bas</Name>
<FileName>cptCriticalPath_bas.bas</FileName>
<Version>v2.7</Version>
<Type>1</Type>
<Directory>Core</Directory>
<Directory>Trace</Directory>
</Module>
<Module>
<Name>cptEvents_cls</Name>
<FileName>cptEvents_cls.cls</FileName>
<Version>v1.1.1</Version>
<Type>2</Type>
<Directory>Core</Directory>
<Name>cptCriticalPathTools_bas</Name>
<FileName>cptCriticalPathTools_bas.bas</FileName>
<Version>v1.0.1</Version>
<Type>1</Type>
<Directory>Trace</Directory>
</Module>
<Module>
<Name>cptUpgrades_frm</Name>
<FileName>cptUpgrades_frm.frm</FileName>
<Name>cptDynamicFilter_bas</Name>
<FileName>cptDynamicFilter_bas.bas</FileName>
<Version>v1.2.1</Version>
<Type>3</Type>
<Directory>Core</Directory>
<Type>1</Type>
<Directory>Text</Directory>
</Module>
<Module>
<Name>cptCountTasks_bas</Name>
<FileName>cptCountTasks_bas.bas</FileName>
<Version>v1.0.1</Version>
<Type>1</Type>
<Directory>Count</Directory>
<Name>cptDynamicFilter_frm</Name>
<FileName>cptDynamicFilter_frm.frm</FileName>
<Version>v1.3.1</Version>
<Type>3</Type>
<Directory>Text</Directory>
</Module>
<Module>
<Name>cptIMSCobraExport_bas</Name>
Expand All @@ -63,6 +63,13 @@
<Type>3</Type>
<Directory>Integration</Directory>
</Module>
<Module>
<Name>cptPatch_bas</Name>
<FileName>cptPatch_bas.bas</FileName>
<Version>19.03.29</Version>
<Type>1</Type>
<Directory></Directory>
</Module>
<Module>
<Name>cptResourceDemand_bas</Name>
<FileName>cptResourceDemand_bas.bas</FileName>
Expand Down Expand Up @@ -105,20 +112,6 @@
<Type>3</Type>
<Directory>Status</Directory>
</Module>
<Module>
<Name>cptDynamicFilter_bas</Name>
<FileName>cptDynamicFilter_bas.bas</FileName>
<Version>v1.2.1</Version>
<Type>1</Type>
<Directory>Text</Directory>
</Module>
<Module>
<Name>cptDynamicFilter_frm</Name>
<FileName>cptDynamicFilter_frm.frm</FileName>
<Version>v1.3.1</Version>
<Type>3</Type>
<Directory>Text</Directory>
</Module>
<Module>
<Name>cptText_bas</Name>
<FileName>cptText_bas.bas</FileName>
Expand All @@ -134,31 +127,38 @@
<Directory>Text</Directory>
</Module>
<Module>
<Name>cptCriticalPathTools_bas</Name>
<FileName>cptCriticalPathTools_bas.bas</FileName>
<Name>cptAbout_frm</Name>
<FileName>cptAbout_frm.frm</FileName>
<Version>v1.1.1</Version>
<Type>3</Type>
<Directory>Core</Directory>
</Module>
<Module>
<Name>cptBrowseFolder_bas</Name>
<FileName>cptBrowseFolder_bas.bas</FileName>
<Version>v1.0.1</Version>
<Type>1</Type>
<Directory>Trace</Directory>
<Directory>Core</Directory>
</Module>
<Module>
<Name>cptCriticalPath_bas</Name>
<FileName>cptCriticalPath_bas.bas</FileName>
<Version>v2.7</Version>
<Name>cptCore_bas</Name>
<FileName>cptCore_bas.bas</FileName>
<Version>v1.3.1</Version>
<Type>1</Type>
<Directory>Trace</Directory>
<Directory>Core</Directory>
</Module>
<Module>
<Name>cptPatch_bas</Name>
<FileName>cptPatch_bas.bas</FileName>
<Version>19.03.29</Version>
<Type>1</Type>
<Directory></Directory>
<Name>cptEvents_cls</Name>
<FileName>cptEvents_cls.cls</FileName>
<Version>v1.1.1</Version>
<Type>2</Type>
<Directory>Core</Directory>
</Module>
<Module>
<Name>cptSetup_bas</Name>
<FileName>cptSetup_bas.bas</FileName>
<Version>v1.2</Version>
<Type>1</Type>
<Directory></Directory>
<Name>cptUpgrades_frm</Name>
<FileName>cptUpgrades_frm.frm</FileName>
<Version>v1.2.1</Version>
<Type>3</Type>
<Directory>Core</Directory>
</Module>
</Modules>
1 change: 1 addition & 0 deletions Integration/cptIMSCobraExport_frm.frm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

'<cpt_version>v3.1.2</cpt_version>

Private Sub bcrBox_Change()
Expand Down
Binary file modified Integration/cptIMSCobraExport_frm.frx
Binary file not shown.
11 changes: 5 additions & 6 deletions ResourceDemand/cptResourceDemand_bas.bas
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ Private Const adVarChar As Long = 200
Sub cptExportResourceDemand(Optional lngTaskCount As Long)
'objects
Dim Task As Task, Resource As Resource, Assignment As Assignment
Dim TSVS As TimeScaleValues, TSV As TimeScaleValue
Dim TSV As TimeScaleValue
Dim TSVS_WORK As TimeScaleValues, TSVS_ACTUAL As TimeScaleValues
Dim xlApp As Excel.Application, Worksheet As Worksheet, Workbook As Workbook
Dim rng As Excel.Range
Dim PivotTable As PivotTable, ListObject As ListObject, PivotChart As ChartObject
Dim rst As Object 'ADODB.Recordset
Dim PivotTable As PivotTable, ListObject As ListObject
'dates
Dim dtStart As Date, dtMin As Date, dtMax As Date
'doubles
Dim dblWork As Double
'strings
Dim strView As String
Dim strFile As String, strGroup As String, strRange As String, strCLIN As String
Dim strTitle As String, strMsg As String, strSQL As String, strHeaders As String
Dim strFile As String, strRange As String
Dim strTitle As String, strHeaders As String
Dim strRecord As String, strFileName As String
'longs
Dim lgFile As Long, lgTasks As Long, lgTask As Long
Expand Down Expand Up @@ -349,7 +348,7 @@ Dim strActiveView As String
Dim strFieldName As String, strFileName As String
'longs
Dim lngResourceCount As Long, lngResource As Long
Dim lngFieldType As Variant, lngField As Long, lngItem As Long
Dim lngField As Long, lngItem As Long
'integers
'booleans
'variants
Expand Down
1 change: 1 addition & 0 deletions ResourceDemand/cptResourceDemand_frm.frm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

'<cpt_version>v1.0.2</cpt_version>
Option Explicit
Private Const BLN_TRAP_ERRORS As Boolean = True
Expand Down
Binary file modified ResourceDemand/cptResourceDemand_frm.frx
Binary file not shown.
1 change: 1 addition & 0 deletions Status/cptSmartDuration_frm.frm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Attribute VB_Exposed = False




'<cpt_version>v1.0</cpt_version>

Public dateError As Boolean
Expand Down
Binary file modified Status/cptSmartDuration_frm.frx
Binary file not shown.
Loading

0 comments on commit b5d816f

Please sign in to comment.