TMGR: OLE Automation Error Accessing Tasks Collection (159795)



The information in this article applies to:

  • Microsoft Team Manager

This article was previously published under Q159795

SYMPTOMS

When using OLE Automation with Microsoft Team Manager, you may receive the following error message:
Run-time error '424':

Object required

CAUSE

You receive this error when using OLE Automation with a Team Manager team file if you try to access a task in the Window.CurrentView.Selection.Tasks collection while the team file has a grouping.

This would most effectively be used in a For - Each loop such as the following:
 For Each oTask In oTm.Window.CurrentView.Selection.Tasks
 MsgBox oTask.TaskName
 Next oTask
				

WORKAROUND

Use the following code to turn off the current grouping in the team file just before using the collection above:
 oTm.Window.CurrentView.RemoveGroupBy
				

MORE INFORMATION

When a team file is grouped by any field, any single task can be repeated in many different groups, depending on the grouping. Because of this, the Tasks collection does not return any tasks because the view can contain duplicates. When trying to access information on a task in the collection, the error will occur.

Modification Type:MinorLast Reviewed:8/17/2005
Keywords:kberrmsg KB159795