在excel中画边框出现错误'Range'的方法'_Global'失败
v = rs1.Fields.Count
X = rs2.RecordCount
xlSheet.Range(Cells(2, 1), Cells((2 + X), v)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
*****************
问题出现在两次应用Access导出数据到Excel中,一次打印,一次把保存,分别为不同的数据表。如果只使用一种不会出现错误,使用两种则会出现错误。错误均是'Range'的方法'_Global'失败,请指教。谢谢