How to know if Process.Start() is successful?

The MSDN page on Process.Start() states that this method has an overload of type Boolean, where the return values mean:

true if a process resource is started;
false if no new process resource is
started (for example, if an existing
process is reused).

Additionally it can throw three exceptions:

  • InvalidOperationException

No file name was specified in the Process component’s StartInfo.


The ProcessStartInfo.UseShellExecute member of the StartInfo property is true while ProcessStartInfo.RedirectStandardInput, ProcessStartInfo.RedirectStandardOutput, or ProcessStartInfo.RedirectStandardError is true.

  • Win32Exception

There was an error in opening the associated file.

  • ObjectDisposedException

The process object has already been disposed.

To use this overload of Process.Start() (which is the only non static overload of the method) you need to create an instance of the Process class using a ProcessStartInfo object.

An example of this is below:

ProcessStartInfo processStartInfo = new ProcessStartInfo("EXCEL.EXE");

Process process = new Process();
process.StartInfo = processStartInfo;
if (!process.Start())
    // That didn't work

Though, given that this can still throw you are probably better of just wrapping a catch around one of the static .Start() method calls.

Given that, it seems clear that the call to Process.Start() will either work or not and you can determine this from the return value being 0 (or an exception being thrown).

Once your process has started you then have a lot of control over things, with properties of the Process class such as HasExited allowing you to check what state the process is in.

In short – if the user does not have excel on their machine, Process.Start() will throw an exception.

Leave a Comment