PRJ: "Run-Time Error" If File Name Extension Not Included (139837)



The information in this article applies to:

  • Microsoft Project 98 for Windows
  • Microsoft Project for Windows 95 4.1

This article was previously published under Q139837

SYMPTOMS

In Microsoft Project, when you use certain Visual Basic for applications methods that take a file name argument, you receive the following error message:
Run-time error 1004

CAUSE

This problem occurs if you fail to include the file name extension with the file name. This problem occurs with the following methods:

OrganizerDeleteItem
OrganizerMoveItem
OrganizerRenameItem
ResourceCalendarEditDays
ResourceCalendarReset
ResourceSharing
ResourceSharingPoolAction
WindowActivate
WindowHide

NOTE: These methods use various arguments for the file name including fileName, filename, projectName, name, and windowName. With other methods (such as FileOpen), you do not need to include a file name extension for the file name argument.

RESOLUTION

To resolve this problem, include the extensions in the file name arguments when you use these methods.

NOTE: One way to do this is to use the FullName property to get the project file name. The FullName property returns the full path, file name, and extension of the file.

STATUS

Microsoft has confirmed this to be a problem in the versions of Microsoft Project listed above.

Modification Type:MajorLast Reviewed:10/7/2003
Keywords:kbbug kbcode kbpending kbusage KB139837