2
private void btnOpenReport_Click(object sender, EventArgs e)
{  
    if (System.IO.File.Exists(outputFilePath))
    {
        Process.Start(new ProcessStartInfo("excel.exe", " /select, " + outputFilePath.Replace("\\\\", "\\")));
     }
}
sid
  • 43
  • 1
  • 1
  • 6
  • 2
    I don't see a question being asked here, or even a description of a problem. I just see some code that isn't even properly formatted. Can you [edit] to actually explain what the problem is with the code you posted, and then ask a question about what you want us to help you with? Thanks. – Ken White Jun 28 '13 at 13:08

1 Answers1

6

Probably you should just start the Excel file directly with property UseShellExecute to true, which is the default, and it will launch the default associated program, most likely Excel itself:

Process.Start(outputFilePath);

Another matter is why you are doing that Replace, but that's probably off-topic here.

rodrigo
  • 94,151
  • 12
  • 143
  • 190