问题如上
解决方案 »
- c#中未处理异常,列名 'LessionID' 无效,求解决
- Team Coherence 代码管理工具,今天由于重新安装 安装后在VS2005源代码管理中没有发现这个插件
- C#中ADO.Net维护Access链接表的操作
- 高分求excel另存为网页的例子
- 装在不同的机器上,有的抱错有的不抱错?错误信息为mscorlib出现异常?不知道为什么?
- 散分,郁闷的问题,好好的TREEVIEW,突然里面的节点图标全部不显示了
- 又是C#小问题请教,谢谢!
- 请问如何画出VS.Net IDE中的控件(按钮)被选中的效果?
- 哪里有ComponentOne Studio下载?
- 如何在 c# 控制台应用程序中显示密码?
- 如何利用C#对图片进行Skew(歪斜的)操作
- 这个Web Service客户端的Polling或者Callback如何写?高分求助,问题解决,立马送分!!
//首先假定你已经引用了excel自动化库,启动了一个excel进程 变量名为_application;
//using Excel = Microsoft.Office.Interop.Excel;
//.....
Excel.Worksheet ws = ( Excel.Worksheet)_application.Workbooks[1].Worksheets[1];
//以下是设定单元格左边框
Excel.Range range = ( Excel.Range )ws.Cells[ 1, 9 ];
range.Borders[Excel.XlBordersIndex.xlEdgeLeft].LineStyle = Excel.XlLineStyle.xlContinuous;
range.Borders[Excel.XlBordersIndex.xlEdgeLeft].Weight = Excel.XlBorderWeight.xlThin;
range.Borders[Excel.XlBordersIndex.xlEdgeLeft].ColorIndex = Excel.XlColorIndex.xlColorIndexAutomatic;
//设定宽度
Excel.Range rc = (Excel.Range)ws.Columns["A","A"];
rc.ColumnWidth = 11.25;
Excel.Range rc = (Excel.Range)ws.Columns["A","A"];
rc.ColumnWidth = 11.25;
===============================================
宽度方式没测试过,想当然写的,有可能要改
Excel.Range rc = (Excel.Range)ws.Columns[1,1];试试
我用这种方式作好后,它们来了句不能装excel,我ri死他们
rangeTemp = mySheet.get_Range( mySheet.Cells[intRowCur,intColDate], mySheet.Cells[intRowCur+1,intColDate+intColDateCnt] );
rangeTemp.Borders[XlBordersIndex.xlEdgeBottom].LineStyle = XlLineStyle.xlContinuous;
rangeTemp.Borders[XlBordersIndex.xlEdgeBottom].Weight = XlBorderWeight.xlThin;
rangeTemp.Borders[XlBordersIndex.xlEdgeBottom].ColorIndex = XlColorIndex.xlColorIndexAutomatic;实际上用excel录制宏是很方便的,做excel你应该学会这点