Вот тебе еще
Dim xlApp As Variant
Dim App As Variant
Dim xlsheet As Variant
Dim Selection As Variant
Const xlEdgeLeft = 7
Const xlEdgeTop = 8
Const xlEdgeBottom = 9
Const xlEdgeRight = 10
Const xlContinuous = 1
Const xlThin = 2
Const xlAutomatic = -4105
Set xlApp = CreateObject("Excel.Application")
With xlApp
.Workbooks.Add
Set xlsheet = .Workbooks(1).Worksheets(1)
xlsheet.Name = "Отчет"
.Visible=True
End With
xlApp.Range("D11:K11").Select
Set Selection = xlApp.Selection
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With