Insert Exceptions into Enterprise Calendar

112 views Asked by At

we are just starting to investigate MS Project Online - Enterprise. I use a couple of VBA scripts in the standard version of MS Project, just can't figure out if its possible to add exceptions using VBA into the Enterprise Calendar. I want to populate at least 10 years worth of public holidays and would rather not manually doing it.

thanks in advance

My existing scripts for adding exceptions are below:

Sub Create_Resource_Exceptions() 'used for resources

Dim e As Exception
Dim cal As Calendar
Dim CalName As String

CalName = ActiveProject.Calendar.name 

ActiveProject.Resources("TempPublicHolidays").Calendar.Exceptions.Add Type:=1, Start:="1/01/2020", Finish:="1/01/2020", name:="New Year's Day"
'copy above to insert more public holidays
End Sub

and

Sub Create_New_Exceptions() ' Used for the base calendar

Dim e As Exception
Dim cal As Calendar
Dim CalName As String

CalName = ActiveProject.Calendar.Name

ActiveProject.BaseCalendars(CalName).Exceptions.Add Type:=1, Start:="1/01/2020", Finish:="1/01/2020", Name:="New Year's Day" ActiveProject.BaseCalendars(CalName).Exceptions.Add Type:=1, 
End Sub
0

There are 0 answers