Dim Style1 As XLS.Style = Book.NewStyle() '定义新样式
style1.BackColor = Color.Gainsboro
style1.AlignHorz = XLS.AlignHorzEnum.Left
style1.AlignVert = XLS.AlignVertEnum.Middle
style1.BorderTop = XLS.LineStyleEnum.Thin
style1.BorderBottom = XLS.LineStyleEnum.Thin
style1.BorderLeft = XLS.LineStyleEnum.Thin
style1.BorderRight = XLS.LineStyleEnum.Thin
style1.Font = New Font("Times New Roman",9)
Dim Style2 As XLS.Style = Book.NewStyle() '定义新样式
style2.AlignHorz = XLS.AlignHorzEnum.Left
style2.BorderTop = XLS.LineStyleEnum.Thin
style2.BorderBottom = XLS.LineStyleEnum.Thin
style2.BorderLeft = XLS.LineStyleEnum.Thin
style2.BorderRight = XLS.LineStyleEnum.Thin
style2.Font = New Font("Times New Roman",7)
For ro1 As Integer = 5 To num + 4 Step +1
If sts2.Contains(ro1-4) Then
Sheet1(ro1,0).Style = style1
Else
Sheet1(ro1,42).Style = style2
End If
Next