Dim xl As New Excel.Application Dim xlBook As Excel.Workbook = xl.Workbooks.Open(strSaveExcelfile) Dim xlSheet As Excel.Worksheet = xlBook.Sheets(1) Dim col As Integer Dim row As Integer xlSheet.Range(xlSheet.Cells(1,1),xlSheet.Cells(80,80)).NumberFormat = "@" '文本格式 For i = 0 To Rlevel.GetUpperBound(0) '标题 row = 1 + i * 7 + 1 xlSheet.Cells(1,row) = Rlevel(i) & "分钟累积" xlSheet.Cells(1,row + 1) = "结束时间" '............ Next '............ xlSheet.Cells.Font.Size = 9 xlSheet.Cells.HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter '所有单元水平居中 xlSheet.Cells.VerticalAlignment = Excel.XlVAlign.xlVAlignCenter '所有单元垂直居中 xlSheet.Cells.EntireColumn.autoFit() '所有列自适合单元宽度 xlSheet.Range("B2").Activate() xl.Application.ActiveWindow.FreezePanes = True '冻结窗口B2单元 xlBook.Save() xlBook.Close() xl.Quit()总结
以上是内存溢出为你收集整理的vb.net *** 作excel汇集全部内容,希望文章能够帮你解决vb.net *** 作excel汇集所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)