LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default 1004 Error: Unable to set the LineStyle property of the Border class

Hi,

I am running excel 2007 on XP-SP2. I am facing a 1004 error: "Unable
to set the LineStyle property of the Border class" at this line
- .Borders(xlDiagonalDown).LineStyle = xlNone

Here is the code snippet:
Sub Generate_Internal_Effort()
'get number of rows
With Worksheets(3)
last_row = .Range(.Cells(3, 2), .Cells(3, 2).End
(xlDown)).Rows.Count
End With

'copy existing rows elsewhere
rnge = "A3:" & "L" & last_row + 2
Range(rnge).Copy Destination:=Worksheets(3).Range("A10000")

Worksheets(3).Range(rnge).Select
' Selection.ClearContents

With Selection
'Remove cell colors
.Interior.ColorIndex = xlNone

'Remove all cell borders
.Borders(xlDiagonalDown).LineStyle = xlNone 'FACING ERROR
HERE!!
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone

'Remove all special font properties and formatting
With .Font
.FontStyle = "Regular"
.Strikethrough = False
.Superscript = False
.Subscript = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
End With

<<Further code exists

End Sub

The above code is in a module. And this code is invoked thru a form
control button on Sheet3. Can anyone tell me whats going wrong here.

Thanks!
Satish
 
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
Error 1004 - unable to set the hastitle property of the axis class Henri Excel Programming 14 November 18th 07 04:21 PM
Error LineStyle property of Border Class NevilleT Excel Programming 2 November 1st 07 11:28 AM
Run-time error '1004': Unable to set the CategoryNames property of the Axis class bodani Excel Programming 0 June 30th 06 04:14 PM
Run time error 1004 - unable to get the chartObjects property of the worksheet class hedgehog1 Excel Programming 1 April 10th 06 08:10 PM
Run time error 1004 - Unable to get add property of the buttons class Mark[_37_] Excel Programming 0 March 1st 04 09:48 AM


All times are GMT +1. The time now is 02:45 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"