在c#中能不能动态的生成一个excel文件,向里边添加数据? 看看这篇文章http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q302084 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以吧,因为都是VBA编程啊一下是一段C#中操作Word的代码,你看看有没有用using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data; if (this.openFileDialog1.ShowDialog() == DialogResult.OK) { object fileName = openFileDialog1.FileName; object readOnly = false; object isVisible = true; object missing = System.Reflection.Missing.Value; // WordApp.Activate(); WordApp.Visible = true; Word.Document aDoc = WordApp.Documents.Open(ref fileName, ref missing,ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible); aDoc.Activate(); WordApp.Selection.TypeText("Copyright C# Corner"); WordApp.Selection.TypeParagraph(); } using Excel;class Excell { public static int Main() { Application exc = new Application(); Workbooks workbooks = exc.Workbooks; _Workbook workbook = workbooks.Add(XlWBATemplate.xlWBATWorksheet); Sheets sheets = workbook.Worksheets;_Worksheet worksheet = (_Worksheet) sheets.get_Item(1);Range range1 = worksheet.get_Range("C1","C1");exc.Visible=true; const int nCells = 1;Object[] args1 = new Object[1];args1[0] = nCells;range1.Value2=100;}www.online.com.cn里面有 Devexpress gridview单元格的边框怎么改 安装问题Vs2010 C#RSA非对称加密如何实现用私钥才能加密,公钥解密? 上传附件判断大小语句不起作用 焦点的问题 贵求读xml文档 属性 c#如何根据时间差显示不同的图标? 协同物流管理平台急招软件开发 在VS2013下怎么给C#的程序换肤? Txt文件读入数据集 我安装了VS.NET以后,以前的Visual SourceSaft出问题了? 如何将TREEVIEW中的树形关系保存到数据库?
一下是一段C#中操作Word的代码,你看看有没有用
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data; if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
{
object fileName = openFileDialog1.FileName;
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value; // WordApp.Activate();
WordApp.Visible = true; Word.Document aDoc = WordApp.Documents.Open(ref fileName, ref missing,ref readOnly,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible); aDoc.Activate(); WordApp.Selection.TypeText("Copyright C# Corner");
WordApp.Selection.TypeParagraph(); }
class Excell
{ public static int Main()
{ Application exc = new Application();
Workbooks workbooks = exc.Workbooks;
_Workbook workbook = workbooks.Add(XlWBATemplate.xlWBATWorksheet);
Sheets sheets = workbook.Worksheets;
_Worksheet worksheet = (_Worksheet) sheets.get_Item(1);
Range range1 = worksheet.get_Range("C1","C1");
exc.Visible=true;
const int nCells = 1;
Object[] args1 = new Object[1];
args1[0] = nCells;
range1.Value2=100;
}www.online.com.cn里面有