|
VB中使用EXCEL输出(11) xls.ActiveWindow.SmallScroll Down:=1 '活动窗口内容向下滚动1行 End If i = i + 1 rst_tsf.MoveNext Loop xlsheet.Range(xlsheet.Cells(6, 3), xlsheet.Cells(i - 1, 9)).NumberFormatLocal = "0.00_ " '保留两位小数 '*********************************添加边框********************************** xlsheet.Range(xlsheet.Cells(3, 1), xlsheet.Cells(i - 1, 9)).Borders.LineStyle = xlContinuous '****************************************************************************** xls.ActiveSheet.PageSetup.BottomMargin = Application.InchesToPoints(2.2) '设置下侧面边距 xls.ActiveSheet.PageSetup.FooterMargin = Application.InchesToPoints(1) '设置页脚高 xls.ActiveSheet.PageSetup.CenterFooter = "&10" & rst_qm.Fields(0) & Chr(10) & Chr(10) & rst_qm.Fields(1) & Chr(10) & Chr(10) & rst_qm.Fields(2) '加页脚 xls.ActiveWindow.View = xlPageBreakPreview '分页预览 xls.ActiveWindow.Zoom = 100 '***************************关闭记录集******************* If con.State = adStateOpen Then rst_tsf.Close rst_qm.Close Set rst_tsf = Nothing Set rst_qm = Nothing con.Close Set con = Nothing End If Set xlsheet = Nothing End Sub
精彩的后续
|