vb 数据导出到excel,并插入背景图片
最好能在选定的区域插入背景图片DimxlAppAsNewexcel.ApplicationDimxlBookAsNewexcel.WorkbookDimxlsheetAs...
最好能在选定的区域插入背景图片
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
请指教!! 展开
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
请指教!! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询