Microsoft KB Archive/242639

= PRJ2000: "Runtime Error 1101..." When You Set Task Calendar in Macro =

Article ID: 242639

Article Last Modified on 1/25/2007

-

APPLIES TO


 * Microsoft Project 2000 Standard Edition

-



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:
 * 1) Open the project in which the macro sets the Calendar property of the task.
 * 2) On the Tools menu, click Organizer.
 * 3) Click the Calendars tab.
 * 4) Under 'GLOBAL.MPT', click the calendar that you want to copy to the project.
 * 5) Click Copy.
 * 6) 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.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Additional query words: base calendar

Keywords: kbbug kbpending KB242639

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.