bsp; End If
i = i + 1
rst_gcl.MoveNext
Loop
xlsheet.Range(xlsheet.Cells(23 + (countpage - 1) * 18, 1), xlsheet.Cells(i - 1, 10)).Borders.LineStyle = xlContinuous ''尾页加边框
i = i + 1 ''加入一空行
''*********************************在尾页加签名***************************************
xlsheet.Range(xlsheet.Cells(i, 1), xlsheet.Cells(i, 10)).MergeCells = True
xlsheet.Cells(i, 1).Value = Space(64) & rst_qm.Fields(0)
xlsheet.Rows(i).RowHeight = 30
i = i + 1 ''换行
xlsheet.Range(xlsheet.Cells(i, 1), xlsheet.Cells(i, 10)).MergeCells = True
xlsheet.Cells(i, 1).Value = Space(50) & rst_qm.Fields(1)
xlsheet.Rows(i).RowHeight = 15
i = i + 1
xlsheet.Range(xlsheet.Cells(i, 1), xlsheet.Cells(i, 10)).MergeCells = True
xlsheet.Cells(i, 1).Value = Space(55) & rst_qm.Fields(2)
xlsheet.Rows(i).RowHeight = 30
''***********************************************************************************
xls.ActiveWindow.View = xlPageBreakPreview ''分页预览
xls.ActiveWindow.Zoom = 100
If con.State = adStateOpen Then
rst_gcl.Close
rst_qm.Close
Set rst_gcl = Nothing
Set rst_qm = Nothing
con.Close
Set con = Nothing
End If
Set xlsheet = Nothing
End Sub
Option Explicit
Public Sub ToExcelTsf(ByRef xlbook, ByRef xls)
Dim con As New ADODB.Connection
Dim rst_tsf As New ADODB.Recordset
Dim rst_qm As New ADODB.Recordset
''**********************************连接数据库************************
con.CursorLocation = adUseClient
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strConnection & ";Persist Security Info=False"
con.Open
rst_tsf.Open "tdefeiyong", con, adOpenKeyset, adLockOptimistic, adCmdTable
If Not (rst_tsf.BOF And rst_tsf.EOF) Then
&