当前位置:编程学习 > VB >>

vb 数据导出到excel,并插入背景图片

最好能在选定的区域插入背景图片 Dim xlApp As New excel.Application Dim xlBook As New excel.Workbook Dim xlsheet As New excel.Worksheet Set xlBook = xlApp.Workbooks.AddSet xlSheet1 = xlBook.Worksheets(1) 。。。 xlSheet1.Range(xlSheet1.Cells(3, 1), xlSheet1.Cells(i + 3, 9)).Select '选中的范围 。。。 xlBook.Save
补充:背景加了也打不出来,算了,换个问题吧。
目的:vb生出数据到excel,再打印
问题:多次打印就会出现问题
表现在:1、Selection.Borders(xlDiagonalDown).LineStyle = xlNone 报 462错误
              2、excel进程无法结束
代码如下:
xlSheet1.Range(xlSheet1.Cells(3, 1), xlSheet1.Cells(i + 3, 9)).Select  '选中加边框的范围
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With
    。。。   
   xlBook.Save
   xlSheet1.PrintOut
   xlApp.Quit
请指教!!
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,