PRJ2000: "Runtime Error 1101..." When You Set Task Calendar in Macro (242639)
The information in this article applies to:
This article was previously published under Q242639 SYMPTOMS
In Microsoft Project, when you run a Microsoft Visual Basic for Applications macro that sets the Calendar property for a task, you may receive the following error message:
Run-time error '1101':
There is a problem with the calendar name.
CAUSE
This error message may occur when you run a Visual Basic for Applications macro that sets the Calendar property for a task and the calendar is located in the Global template, and not in the project that contains the task for which you are setting the calendar.
WORKAROUND
To work around this behavior, copy the calendar to the project that contains the task for which you are setting the task calendar. To do this, follow these steps:
- Open the project in which the macro sets the Calendar property of the task.
- On the Tools menu, click Organizer.
- Click the Calendars tab.
- Under 'GLOBAL.MPT', click the calendar that you want to copy to the project.
- Click Copy.
- Click Close.
The calendar is now in the project and when you run the macro in the project, you do not receive the error described in the "Symptoms" section of this article.
Alternately, you can copy the calendar can into the project by adding the OrganizerMoveItem method to your macro, for example:
Sub CalMove()
OrganizerMoveItem Type:=pjCalendars, FileName:="global.mpt", _
Tofilename:=ActiveProject.Name, Name:="Calendar1"
ActiveProject.Tasks(1).Calendar = "Calendar1"
End Sub
NOTE: You only need to copy the calendar to the project once, so you may want to test if the calendar is already in the project. If it is, bypass the lines that copy the calendar into the project.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 10/17/2002 |
---|
Keywords: | kbbug KB242639 |
---|
|