Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Runtime error on a PC: Selection.Borders(xlEdgeLeft).TintAndShade =-0.14996795556505

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:P").Select
' Add light grey gridlines
GreyGridlines
. . .



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Runtime error on a PC: Selection.Borders(xlEdgeLeft).TintAndShade

TintAndShade is not a property of the Borders collection object in xl2003.
He has the option of Color or ColorIndex.

"Alan" wrote:

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:P").Select
' Add light grey gridlines
GreyGridlines
. . .




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Runtime error on a PC: Selection.Borders(xlEdgeLeft).TintAndShade

Thanks! Alan
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with .TintAndShade Jair Batista Excel Programming 6 September 15th 09 02:33 PM
.TintAndShade under Excel2003 Jon Peltier Excel Programming 0 February 2nd 09 12:29 PM
runtime Error '424' using Application.Selection malpropio Excel Programming 4 March 20th 07 12:45 PM
Selection.Borders and replace with new colour procedure webby2006[_4_] Excel Programming 0 August 1st 06 01:49 PM


All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"