在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里面有 关于导出到excel中自带公式 AppDomain问题 如何在CS程序中给一个在IE浏览器打开的页面中的文本框(input控件)赋值 数据库更新问题 接《比较另类的表达式计算》 最近没什么课,想买本书看看,望大家指点一下. 如何解决这样的并发访问问题? 关于不同窗口之间组件引用问题。。急。 关于remoting的问题!!穿过防火墙和代理的问题!在线等待!!快进来!! C# 连接 AB PLC 我安装了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里面有