C# Code to launch excel and open the associated spreadsheet (not looking to modify)


I need a line of code to open an excel spreadsheet - not access\modify but physically launch excel as if I had double clicked on the spreadsheet itself.

As in OPEN C:\MYSHEET.XLS and have it launch excel and display the sheet . I am not looking to do COM or ODBC connections or anything.

Who is Participating?
badbearontourConnect With a Mentor Commented:
Hi there

the quick and dirty way is to use this


this will work with any file that is associated with the Excel Program

Karl66Author Commented:
Works great - does it only work with excel?
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
It will work with any extension that is REGISTERED on the system.  Process.Start() launches the associated executable and passes the filename as a command line parameter...
Mike TomlinsonMiddle School Assistant TeacherCommented:
So, by default, for example...

    .txt --> NotePad
    .doc --> MSWord
    .xls --> MSExcel

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.