メソッドに貼り付けるだけで機能するソースコードを多数用意しています。
Excel閉じる
ExcelBook、アプリケーションを閉じる
Excelを閉じる処理です。
「◆Bookを閉じる◆」で、WorkBookを閉じる処理を行い、
「◆Excelアプリケーション閉じる◆」で、アプリケーションの終了処理を行っています。
{
    // Excel操作用オブジェクト
    Application xlApp = null;
    Workbooks xlBooks = null;
    Workbook xlBook = null;
    Sheets xlSheets = null;
    Worksheet xlSheet = null;
    // Excelアプリケーション生成
    xlApp = new Application();
    xlApp.DisplayAlerts = false;    // 確認メッセージを非表示に設定
    // 新規のExcelブックを開く
    xlBooks = xlApp.Workbooks;
    xlBook = xlBooks.Add();
    // シートを選択する
    xlSheets = xlBook.Worksheets;
    xlSheet = xlSheets[1] as Worksheet; // 1シート目を操作対象に設定する
    // 確認のためExcelを表示させて3秒停止
    xlApp.Visible = true;
    System.Threading.Thread.Sleep(3000);
    // ■■■以下、COMオブジェクトの解放■■■
    // Sheet解放
    System.Runtime.InteropServices.Marshal.ReleaseComObject(xlSheet);
    System.Runtime.InteropServices.Marshal.ReleaseComObject(xlSheets);
    // ◆Bookを閉じる◆
    // Closeメソッド
    xlBook.Close();
    System.Runtime.InteropServices.Marshal.ReleaseComObject(xlBook);
    System.Runtime.InteropServices.Marshal.ReleaseComObject(xlBooks);
    // アラートを元に戻す
    xlApp.DisplayAlerts = true;
    // ◆Excelアプリケーション閉じる◆
    // Quitメソッド
    xlApp.Quit();
    System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp);
}
既存のExcelファイルを開く
既存のExcelファイルを開く処理です。
新規ファイルを開く際はAddメソッドを使用しましたが、既存ファイルを開く場合はOpenメソッドを使用します。
xlBooks.Open(fileNm)の、[fileNm]には、対象ファイルの絶対パスを指定します。
            // Excel操作用オブジェクト
            Microsoft.Office.Interop.Excel.Application xlApp = null;
            Microsoft.Office.Interop.Excel.Workbooks xlBooks = null;
            Microsoft.Office.Interop.Excel.Workbook xlBook = null;
            Microsoft.Office.Interop.Excel.Sheets xlSheets = null;
            Microsoft.Office.Interop.Excel.Worksheet xlSheet = null;
            // Excelアプリケーション生成
            xlApp = new Microsoft.Office.Interop.Excel.Application();
            // ◆操作対象のExcelブックを開く◆
            // Openメソッド
            xlBooks = xlApp.Workbooks;
            xlBook = xlBooks.Open(System.IO.Path.GetFullPath(@"..\..\..\data\work01.xlsx"));
            // シートを選択する
            xlSheets = xlBook.Worksheets;
            xlSheet = xlSheets[1] as Microsoft.Office.Interop.Excel.Worksheet; // 1シート目を操作対象に設定する
            // 表示
            xlApp.Visible = true;
            // ■■■以下、COMオブジェクトの解放■■■
            // Sheet解放
            System.Runtime.InteropServices.Marshal.ReleaseComObject(xlSheet);
            System.Runtime.InteropServices.Marshal.ReleaseComObject(xlSheets);
            // Book解放
            //xlBook.Close();
            System.Runtime.InteropServices.Marshal.ReleaseComObject(xlBook);
            System.Runtime.InteropServices.Marshal.ReleaseComObject(xlBooks);
            // Excelアプリケーションを解放
            //xlApp.Quit();
            System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp);
