VB 操作 EXCEL,实现数据写入以与数据组合1]定义 EXCEL 的一系列操作Dim xlApp As Excel
ApplicationDim ExcelShowStr As StringSet xlApp = CreateObject("Excel
Application")xlApp
Visible = trueAppLogFile
WriteLine (CStr(Date) & "_" & CStr(Time) & ":Set xlApp=new Excel
Application")Dim xlBook As WorkbookDim xlSheet As WorksheetDim xlrow, sheetIndex, sheetColumn As Integer'fileurl ="D:\VB 英迈\Template\WriteData
xls" Editable=空值Set xlBook = xlApp
Workbooks
Open(fileUrl, Editable) '打开 EXCEL 模板Set xlSheet = xlApp
ActiveSheet--------------------------------------------------------------------------------------------[2]写入数据的操作xlSheet
Range(xlSheet
Cells(beginRow, 1), xlSheet
Cells(endRow - 1, 1))
Merge '合并单元格xlSheet
Cells(beginRow, 1)
FormulaR1C1 = CustName '单行插入xlSheet
Cells(beginRow, 1)
VerticalAlignment =