using System; using System.Collections.Generic; using System.Text; using Microsoft.Office.Tools.Excel; using System.Windows.Forms; using Excel; namespace serial_port { class InsertPictureToExcel { public void Open() { this.Open(String.Empty); } /// <summary> /// 功能:实现Excel应用程序的打开 /// </summary> /// <param name="TemplateFilePath">模板文件物理路径</param> public void Open(string TemplateFilePath) { //打开对象 m_objExcel = new Excel.Application(); m_objExcel.Visible = false; m_objExcel.DisplayAlerts = false; if (m_objExcel.Version != "11.0") { MessageBox.Show("您的 Excel 版本不是 11.0 (Office 2003),操作可能会出现问题。"); m_obj