顶!我最近也在干这个,想知道
另外作完安装程序后老出现找不到interpob.excel,我明明加上了阿
另外作完安装程序后老出现找不到interpob.excel,我明明加上了阿
解决方案 »
- 急!以Html格式复制黏贴时,中文内容变成乱码--冰天雪地,跪求仙人指路
- 实例化Model时怎么返回我想要的成员
- 如何创建一个后台服务?
- 如何在ComboBox中下拉DataGridView,并将组合后的控件再以DataGridViewColumn放置在DataGridView控件中?
- 正则表达式 求救:匹配连续数字如,123,456.
- C# 自定义控件,直接继承还是从UserControl继承
- 怎么样取得 一个结构的首地址 或者是 用也各指针指向该结构
- 在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的节是错误的。
- C# 用SYSTEM账户启动外部程序失败
- 关于一个小弟在网上看到的小游戏~
- application.exe.config是不是程序配置信息文件?如何实现他?
- 高分求购以下内容源码供初学者参考
使用excel的录制宏的功能录制你想要的操作,然后对宏进行修改!!
ExcelApp.DisplayAlerts = False;
ExcelWorkSheet.get_Range("A1:B2").Select();
ExcelWorkSheet.Selection.HorizontalAlignment = xlCenter;
ExcelWorkSheet.Selection.Merge;
在宏中有的属性,方法,在c#中有的没有.
workbook.Saved = false;
workbook.SaveCopyAs(saveFilePath);
workbook.Saved = true;
if(MessageBox.Show("Export excel successfully! View it ?" ,"" ,MessageBoxButtons.YesNo) == DialogResult.Yes)
excel.Visible = true;
else
{
excel.UserControl = false;
excel.Quit();
}为何这样退出后Excel进程Excel进程还在,并且打不开刚刚导出的Excel?
excel.save();
excel.close();
就高顶拉
http://expert.csdn.net/Expert/topic/1454/1454452.xml?temp=.4643824
是不是同理啊
appWorkSheet.Range(appWorkSheet.Cells(1, 1), appWorkSheet.Cells(1, intMaxDetailCol)).MergeCells = True
appWorkSheet.Range(appWorkSheet.Cells(1, 1), appWorkSheet.Cells(1, intMaxDetailCol)).HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter
appWorkSheet.Range(appWorkSheet.Cells(1, 1), appWorkSheet.Cells(1, intMaxDetailCol)).Font.FontStyle = "Bold"
appWorkSheet.Range(appWorkSheet.Cells(1, 1), appWorkSheet.Cells(1, intMaxDetailCol)).Font.Size = 24Dim range As Excel.Range = appWorkSheet.Range(appWorkSheet.Cells(intOldRow + 2, 1), appWorkSheet.Cells(intDetailRow, intDetailCol)) range.Borders(Excel.XlBordersIndex.xlInsideHorizontal).LineStyle = Excel.XlLineStyle.xlContinuous
range.Borders(Excel.XlBordersIndex.xlInsideVertical).LineStyle = Excel.XlLineStyle.xlContinuous
range.Borders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlContinuous
range.Borders(Excel.XlBordersIndex.xlEdgeBottom).Weight = Excel.XlBorderWeight.xlMedium
range.Borders(Excel.XlBordersIndex.xlEdgeLeft).LineStyle = Excel.XlLineStyle.xlContinuous
range.Borders(Excel.XlBordersIndex.xlEdgeLeft).Weight = Excel.XlBorderWeight.xlMedium
range.Borders(Excel.XlBordersIndex.xlEdgeRight).LineStyle = Excel.XlLineStyle.xlContinuous
range.Borders(Excel.XlBordersIndex.xlEdgeRight).Weight = Excel.XlBorderWeight.xlMedium
range.Borders(Excel.XlBordersIndex.xlEdgeTop).LineStyle = Excel.XlLineStyle.xlContinuous
range.Borders(Excel.XlBordersIndex.xlEdgeTop).Weight = Excel.XlBorderWeight.xlMedium
然后在project中引用EXCEL对象
当出现ErrMessage"拒绝访问。"时
在运行中输入dcomcnfg.exe
在弹出的对话框中分别设置microsoft excel对象的访问权和调用权限;
设置前两个选项:允许访问和允许调用 就可以了
添加 你的机器名/ASPNET这个用户到这两个权限设置中去
http://www.uncj.net/Exce.htm