Share via


Application.OptionsCalendar Method

Project Developer Reference

Sets options for the calendar of the active project.

Syntax

expression.OptionsCalendar(StartWeekOnMonday, StartYearIn, StartTime, FinishTime, HoursPerDay, HoursPerWeek, SetDefaults, StartWeekOn, UseFYStartYear, DaysPerMonth)

expression   A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
StartWeekOnMonday Optional Boolean True if the calendar week starts on Monday. False if the calendar week starts on Sunday. If StartWeekOn is specified, StartWeekOnMonday is ignored. (The StartWeekOn argument is a better way to specify the start of the week.)
StartYearIn Optional Long The first month of the fiscal year. Can be one of the PjMonth constants.
StartTime Optional Variant The default start time for working days.
FinishTime Optional Variant The default finish time for working days.
HoursPerDay Optional Double The default number of work hours per day.
HoursPerWeek Optional Double The default number of work hours per week.
SetDefaults Optional Boolean True if the values of StartYearIn, StartTime, FinishTime, HoursPerDay, HoursPerWeek, StartWeekOn, and UseFYStartYear are used as the default values for new projects. The default value is False.
StartWeekOn Optional Long The first day of the week. Can be one of the PjWeekday constants.
UseFYStartYear Optional Boolean True if a fiscal year is determined by the year of the first month of that fiscal year. False if determined by the last month of the fiscal year.
DaysPerMonth Optional Double The default number of work days per month. For example, if StartYearIn was pjJuly (to denote July 2000) and UseFYStartYear was True, the fiscal year ending in June 2000 would be FY99.

Return Value
Boolean

Remarks

If an argument is omitted, its default value is specified by the current setting on the Calendar tab of the Options dialog box.

Example
The following example sets the first month of the fiscal year to April, default number of work hours per day to 4 hours and default number of work hours per week to 20 hours.

Visual Basic for Applications
  Sub Options_Calendar()
Dim HoursDay As Double
Dim HoursWeek As Double

HoursDay = 4
HoursWeek = 20

<strong class="bterm">OptionsCalendar</strong> StartYearIn:=pjApril, HoursPerDay:=HoursDay, HoursPerWeek:=HoursWeek

End Sub

See Also