![](https://csdnimg.cn/release/download_crawler_static/87078109/bg1.jpg)
(完整 word 版)VB 中对 Excel 编程操作实例
VB 中对 Excel 编程操作实例
vb excel 编程技巧,实例,格式,合并单元格,表格线,页面横向
Dim xlApp As excel。Application
Dim xlBook As excel。Workbook
Dim xlSheet As excel。Worksheet
Set xlApp = CreateObject(”Excel。Application")
Set xlBook = xlApp.Workbooks。Add
Set xlSheet = xlBook.Worksheets(1)
Dim xRange As excel.Range
Dim m5 As String
Dim msgss As Boolean
’On Error GoTo 99
With xlSheet
If abcd = True Then tmp2 = ”台," Else tmp2 = "个,”
If dataM >; 5 Then m5 = ” 数量:" & dataM & tmp2
Else m5 = " "
.Cells(1, 1)。Value = lb1。Caption & m5 &;
Label15.Caption
。Cells(2, 1)。Value = ”基本信息"
.Cells(6, 1).Value = ”额定性能” &; Chr(10) &
Text1。Text & "rpm”
.Cells(11, 1)。Value = ”堵转”
。Columns(1)。ColumnWidth = 8 ’表格宽度