Skip to content

Commit

Permalink
Merge branch 'issue367-fixCriticalPathTools'
Browse files Browse the repository at this point in the history
  • Loading branch information
AronGahagan committed Dec 21, 2023
2 parents 3944039 + a03abe0 commit 03cbbbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CurrentVersions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
<Module>
<Name>cptCriticalPathTools_bas</Name>
<FileName>cptCriticalPathTools_bas.bas</FileName>
<Version>v1.0.6</Version>
<Version>v1.0.7</Version>
<Type>1</Type>
<Directory>Trace</Directory>
</Module>
Expand Down
11 changes: 6 additions & 5 deletions Trace/cptCriticalPathTools_bas.bas
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Attribute VB_Name = "cptCriticalPathTools_bas"
'<cpt_version>v1.0.6</cpt_version>
'<cpt_version>v1.0.7</cpt_version>
Option Explicit

Sub cptExportCriticalPath(ByRef oProject As MSProject.Project, Optional blnSendEmail As Boolean = False, Optional blnKeepOpen As Boolean = False, Optional ByRef oTargetTask As MSProject.Task)
Expand Down Expand Up @@ -57,7 +57,7 @@ Dim vPath As Variant
strFileName = cptRegEx(ActiveProject.Name, "[^\\/]{1,}$")
strFileName = Replace(strFileName, ".mpp", "")
strFileName = Replace(strFileName, " ", "_")
strFileName = strDir & "-CriticalPathAnalysis-" & Format(Now, "yyyy-mm-dd") & ".pptx"
strFileName = strDir & cptGetProgramAcronym & "-CriticalPathAnalysis-" & Format(Now, "yyyy-mm-dd") & ".pptx"
On Error Resume Next
Set pptExists = oPowerPoint.Presentations(strFileName)
If cptErrorTrapping Then On Error GoTo err_here Else On Error GoTo 0
Expand Down Expand Up @@ -99,10 +99,10 @@ Dim vPath As Variant
On Error Resume Next
Set oTasks = ActiveSelection.Tasks
If cptErrorTrapping Then On Error GoTo err_here Else On Error GoTo 0
If Tasks Is Nothing Then GoTo next_path
If oTasks Is Nothing Then GoTo next_path
'account for when task count exceeds easily visible range
'on powerpoint slide
lngTasks = Tasks.Count
lngTasks = oTasks.Count
lngSlide = 0
lngTask = 0
Do While lngTask <= lngTasks
Expand All @@ -115,7 +115,7 @@ Dim vPath As Variant
oPresentation.Slides.Add oPresentation.Slides.Count + 1, ppLayoutCustom
Set oSlide = oPresentation.Slides(oPresentation.Slides.Count)
oSlide.Layout = ppLayoutChart
oSlide.Shapes(1).TextFrame.TextRange.Text = Choose(vPath, "Primary", "Secondary", "Tertiary") & " Critical Path" & IIf(lngSlide > 1, " (cont'd)", "")
oSlide.Shapes(1).TextFrame.TextRange.Text = Choose(vPath, "Primary", "Secondary", "Tertiary", "Quaternary", "Quinary") & " Critical Path" & IIf(lngSlide > 1, " (cont'd)", "")
oSlide.Shapes(2).Delete
oSlide.Shapes.Paste
oSlide.Shapes(oSlide.Shapes.Count).Width = oSlide.Master.Width * 0.9
Expand All @@ -141,6 +141,7 @@ exit_here:
Set pptExists = Nothing
Set oTargetTask = Nothing
Set oTask = Nothing
Set oTasks = Nothing
Set oPowerPoint = Nothing
Set oPresentation = Nothing
Set oSlide = Nothing
Expand Down

0 comments on commit 03cbbbe

Please sign in to comment.