C# automation Excel

C# automation Excel
添加using:
using System.Reflection;
using Excel = Microsoft.Office.Interop.Excel;


加入引用:

C:\Program Files\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office12\Microsoft.Office.Interop.Excel.dll

測試代碼:
namespace Tmp
{
    class Program
    {
        static void Main(string[] args)
        {
            Excel.Application app = null;
            app = new Excel.Application();

            if ( null != app )
            {
                app.Visible = true;
                //TODO: do something
                app.Quit();
            }
        }
    }
}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章