User had cptFiscalCalendar but it had no exceptions. Root cause may be the template upload process: investigate.
Function cptCalendarExists(strCalendar As String) As Boolean
Dim oCalendar As MSProject.Calendar
On Error Resume Next
Set oCalendar = ActiveProject.BaseCalendars(strCalendar)
If cptErrorTrapping Then On Error GoTo err_here Else On Error GoTo 0
If oCalendar Is Nothing Then
cptCalendarExists = False
Else
cptCalendarExists = True
End If
exit_here:
On Error Resume Next
Set oCalendar = Nothing
Exit Function
err_here:
Call cptHandleErr("cptResourceDemand_bas", "cptCalendarExists", Err, Erl)
Resume exit_here
End Function
Solution:
Function cptCalendarExists(strCalendar As String) As Boolean
Dim oCalendar As MSProject.Calendar
Dim strMsg As String
On Error Resume Next
Set oCalendar = ActiveProject.BaseCalendars(strCalendar)
If cptErrorTrapping Then On Error GoTo err_here Else On Error GoTo 0
If oCalendar Is Nothing Then
cptCalendarExists = False
Else
If oCalendar.Exceptions.Count = 0 Then
strMsg = "cptFiscalCalendar exists but has no exceptions." & vbCrLf & vbCrLf
strMsg = strMsg & "Please rebuild it (ClearPlan > Calendars > Fiscal)."
MsgBox strMsg, vbCritical + vbOKOnly, "No Exceptions"
oCalendar.Delete
cptCalendarExists = False
Else
cptCalendarExists = True
End If
End If
exit_here:
On Error Resume Next
Set oCalendar = Nothing
Exit Function
err_here:
Call cptHandleErr("cptResourceDemand_bas", "cptCalendarExists", Err, Erl)
Resume exit_here
End Function
Todo:
[x] assign this issue
[x] label the issue for enhancement or bug
[x] label the issue with codemodule (so fixes can be aggregated and hotfixed together)
[x] checkout appropriate branch and create topic branch
[x] design, code and test
[x] update codemodule x.y.z
[x] update CurrentVersions.xml manually
[x] commit changes prefix comment with Issue #XXX -
[x] merge topic into appropriate branch(es) and push
Problem:
User had
cptFiscalCalendar
but it had no exceptions. Root cause may be the template upload process: investigate.Solution:
Todo:
topic
branchIssue #XXX -
topic
into appropriate branch(es) and push