I have a DTS package that creates an Excel workbook and writes data to it. That part works fine, but I am trying to set some formatting from a VBScript and it isn't working. Here is the relevant code snippet:
The font face, size, style (bold) and color are all fine, but it is not setting the background color - it apparently is ignoring the ".Interior.ColorIndex = 15" part. Can anyone help?
Code:
Dim s
For Each s in objXLB.Worksheets
With s.Range("A1:IV65536").Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.ColorIndex = xlAutomatic
objLogFile.WriteLine("Font formatted.")
End With
With s.Range("A1:IV1")
.Font.FontStyle = "Bold"
.Interior.ColorIndex = 15
.Interior.Pattern = xlSolid
objLogFile.WriteLine("Top row formatted.")
End With
Next
The font face, size, style (bold) and color are all fine, but it is not setting the background color - it apparently is ignoring the ".Interior.ColorIndex = 15" part. Can anyone help?