Knowledge Base

BUG: Shell Returns Invalid Proc Call Even If App Starts

Article ID: 114001

Article Last Modified on 10/11/2006


APPLIES TO


This article was previously published under Q114001

SYMPTOMS

The Shell statement can cause a Invalid Procedure Call even though the Shell statement successfully started the desired application.

WORKAROUND

To work around this bug, turn error trapping on and trap the Invalid Procedure Call error as in this example:
   On Error Resume Next 
   Shell("C:\WINDOWS\NOTEPAD.EXE")
 ' Invalid Procedure Call:
  
   If Err <> 5  Then
 
      ' Insert code to handle other errors here.
      ' Exit if fatal

   End if
				

STATUS

Microsoft has confirmed this to be a bug in Microsoft Visual Basic, Applications Edition, version 1.0 that comes with Microsoft Excel version 5.0 and Microsoft Project version 4.0. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

Keywords: kbbug kbprogramming KB114001