导出excel自动列宽,行高设定的问题
--------------------编程问答-------------------- 同问,顶 --------------------编程问答-------------------- http://www.hackchina.com/dlpre.php?id=190134去下载这个,研究一下
超级好用 --------------------编程问答--------------------
--------------------编程问答--------------------
DataGridView2.Columns(0).Width = 20
DataGridView2.Columns(1).Width = 20
DataGridView2.Columns(2).Width = 50
DataGridView2.Columns(3).Width = 120
--------------------编程问答-------------------- 帮顶下
Dim XlsApp As Microsoft.Office.Interop.Excel.Application
Dim XlsBk As Microsoft.Office.Interop.Excel.Workbook
Dim XlsSt As Microsoft.Office.Interop.Excel.Worksheet
Dim XlsRg As Microsoft.Office.Interop.Excel.Range
XlsSt.Cells(1, 1) = "EXCEL cells operation demo"
XlsRg = XlsSt.Range(XlsSt.Cells(1, 1), XlsSt.Cells(1, 6))
XlsRg.Merge()
XlsRg.Borders(1).Weight = 3 : XlsRg.Borders(2).Weight = 3
XlsRg.Borders(3).Weight = 3 : XlsRg.Borders(4).Weight = 3
XlsRg.Columns.AutoFit()
XlsRg.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter
XlsRg.VerticalAlignment = Microsoft.Office.Interop.Excel.XlVAlign.xlVAlignCenter
补充:.NET技术 , VB.NET