Private Sub 打印_Click()
If MS1.Rows = 1 Then MsgBox "请先选择要打印的数据!", vbExclamation: Exit Sub
Set xlapp = New Excel.Application
Set xlapp = CreateObject("Excel.Application")
xlapp.Visible = False
Dim mb, temp As String
mb = "D:\mkbbarcode\excel\clbh.xls"
' temp = "D:\mkbbarcode\excel\temp.xls"
' FileCopy mb, temp
' Set xlbook = xlapp.Workbooks.Open(temp)
Set xlbook = xlapp.Workbooks.Open(mb)
Set xlsheet = xlbook.Worksheets(1)
Dim i, j As Integer
For i = 1 To 12
' If Trim(MS1.TextMatrix(MS1.row, i)) <> "" Then xlsheet.Cells(2, i) = Trim(MS1.TextMatrix(MS1.row, i))
xlsheet.Cells(2, i) = Trim(MS1.TextMatrix(MS1.row, i))
Next i
xlbook.Save
xlapp.quit
Set xlapp = Nothing
' Dim btApp As BarTender.Application
' Dim btFormat As BarTender.Format
' Dim btdb As BarTender.database
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载