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

Posted on 2007-08-01
Last Modified: 2008-01-09

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.

Question by:Karl66
    LVL 7

    Accepted Solution

    Hi there

    the quick and dirty way is to use this


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


    Author Comment

    Works great - does it only work with excel?
    LVL 85

    Assisted Solution

    by:Mike Tomlinson
    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...
    LVL 85

    Expert Comment

    by:Mike Tomlinson
    So, by default, for example...

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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
    The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now