摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runtime.InteropServices;using Excel = Microsoft.Office.Interop.Excel;using System.Diagnostics;using System.IO;using System.Collections;using System.Data;namespace Core.Helper{ /// <summary> /// excel 阅读全文
posted @ 2012-06-12 14:39 Ruiky 阅读(4640) 评论(2) 推荐(1)
摘要: 网上比较多讲述如何操作Excel表的文章,但都是启动Excel的窗口来打开Excel数据文件。有时候需要把Excel表嵌入到自己程序的Form中,给客户一个不用切换窗口的操作界面,似乎更好。这在VC中用OLE技术很容易实现,但是在C#中方法就不一样啦。下面将就此进行阐述。一、首先简要回顾一下如何操作Excel表先要添加对Excel的引用。选择项目-〉添加引用-〉COM-〉添加Microsoft Excel 9.0。(不同的office讲会有不同版本的dll文件)。using Excel;using System.Reflection;//产生一个Excel.Application的新进程E.. 阅读全文
posted @ 2012-06-12 14:15 Ruiky 阅读(1224) 评论(1) 推荐(2)