日期:2014-05-17  浏览次数:20837 次

如何在EXCEL中插入数据?
我想在EXCEL中插入我一个变量中的数据,比如在EXCEL中的A10处插入变量data的内容,怎么实现呢?我用的是office2007,如果是WPS呢?

------解决方案--------------------
http://blog.csdn.net/fangxinggood/article/details/655313
------解决方案--------------------
C# code
 MSEXCEL.Application excelapp=new Microsoft.Office.Interop.Excel.Application();
                object objOpt = System.Reflection.Missing.Value;
                MSEXCEL.Workbook exceelDoc = excelapp.Workbooks.Open(this.saveFileDialog1.FileName, objOpt, false, objOpt, objOpt, objOpt, true, objOpt, objOpt, true, objOpt, objOpt, objOpt, objOpt, objOpt);
                MSEXCEL.Worksheet ws = (MSEXCEL.Worksheet)exceelDoc.Sheets[1];
                MSEXCEL.Range r;
                r = ws.get_Range("单元格横坐标", "单元格纵坐标");
                r.Value2 = this.comboBox1.SelectedText;
                exceelDoc.Save();