A
Alan
I have some code that formats a spreadsheet. A user running Excel
2003 gets a runtime error on the ".TintAndShade" statement below. I
do not get an error. Could this be related to some Reference I need
to set programmatically?
I took this code fragment from a recorded macro.
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.TintAndShade = -0.14996795556505
.Weight = xlThin
The complete subroutine is shown below.
Thanks, Alan
Sub GreyGridlines()
'
' This subroutine adds light grey gridlines to selected
' columns of the output spreadsheet
'
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.TintAndShade = -0.14996795556505
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.TintAndShade = -0.14996795556505
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.TintAndShade = -0.14996795556505
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.TintAndShade = -0.14996795556505
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.TintAndShade = -0.14996795556505
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.TintAndShade = -0.14996795556505
.Weight = xlThin
End With
End Sub
The way this is called is by this subroutine:
Sub SetCellFormats(CmdWB As Workbook, DataWB As Workbook)
'
' This subroutine modifies the format of the cells in Rows
' A through P of the output spreadsheet
''
Dim i As Integer, DataRowCount As Integer
Dim switch As Boolean, MyFont As Font
' Select the columns to modify
Columns("A").Select
' Add light grey gridlines
GreyGridlines
. . .
2003 gets a runtime error on the ".TintAndShade" statement below. I
do not get an error. Could this be related to some Reference I need
to set programmatically?
I took this code fragment from a recorded macro.
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.TintAndShade = -0.14996795556505
.Weight = xlThin
The complete subroutine is shown below.
Thanks, Alan
Sub GreyGridlines()
'
' This subroutine adds light grey gridlines to selected
' columns of the output spreadsheet
'
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.TintAndShade = -0.14996795556505
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.TintAndShade = -0.14996795556505
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.TintAndShade = -0.14996795556505
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.TintAndShade = -0.14996795556505
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.TintAndShade = -0.14996795556505
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.TintAndShade = -0.14996795556505
.Weight = xlThin
End With
End Sub
The way this is called is by this subroutine:
Sub SetCellFormats(CmdWB As Workbook, DataWB As Workbook)
'
' This subroutine modifies the format of the cells in Rows
' A through P of the output spreadsheet
''
Dim i As Integer, DataRowCount As Integer
Dim switch As Boolean, MyFont As Font
' Select the columns to modify
Columns("A").Select
' Add light grey gridlines
GreyGridlines
. . .