Opening different version of Excel from C# using interop


  • I have 2 different versions of excel , 2007 and 2010, installed in my test machine. I am using excel interop for excel programming. Below code when executed, opens the excel application for me. But I want to be able to control which version of Excel to open. Currently the registry key shows 2007 as default so it always opens 2007 version of Excel. I tried updating the default excel to 2010, but it doesn't work. Any pointers will be helpful.

    _excelApp = new Excel.Application();                
                    //string s=_excelApp.Version;
                    _excelApp.Visible = true;
                    _excelApp.UserControl = true;
                    oWB = (Excel._Workbook)_excelApp.Workbooks.Add(Type.Missing);

    • Moved by George123345 Friday, September 27, 2013 5:17 AM code
    Thursday, September 26, 2013 10:45 PM

All replies