PRJ4: "Cannot Read From Drive" Error Using AppExecute Method

ID: Q126801

The information in this article applies to:

SYMPTOMS

In Microsoft Project, if you use the AppExecute method in a macro to start an application, you may receive the following error message when you run the macro

   System Error

   Cannot read from drive <n>

where <n> is the first letter in the name of the application that you are trying to run.

CAUSE

This behavior occurs if the command argument of the AppExecute method begins with a capital letter, and the capital letter is not a drive letter in a path to the application. For example, if you use the command argument "Analyzer.exe", (a valid command if the Analyzer application is located in a directory that is contained in the path statement in your AUTOEXEC.BAT file), you receive a system error indicating that the system cannot read from drive A.

This behavior occurs because the AppExecute method assumes that if the first character in the command argument is capitalized, the character is a drive letter. Therefore, it incorrectly tries to locate the application on this drive.

Note that if there is a disk in the drive that the AppExecute method is searching, you do not receive a system error. In this case, the drive is accessed, and the application starts as expected.

WORKAROUNDS

To work around this problem when you use the AppExecute method, use all lowercase letters in a command argument that does not contain a path to the application. For example, if you are using the AppExecute method to run the Analyzer application that is shipped with Microsoft Project, use the following syntax:

   Sub RunApp()
      AppExecute "analyzer.exe"
   End Sub

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

You can use the AppExecute method in a macro to run an application. The command argument of the AppExecute method is a string expression that specifies the command to start the application. However, if the command argument that you use begins with a capital letter, and this letter is not used to specify the drive letter in the path to the application, you may receive a system error as described above.

REFERENCES

For more information about the AppExecute Method, choose the Search button in Help and type:

   AppExecute

Additional query words: 4.00
Keywords          : kbcode kbprg
Version           : 4.0
Platform          : WINDOWS

Last Reviewed: November 25, 1997