Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
1004 Error: Unable to set the LineStyle property of the Borderclass
On Aug 24, 5:23*pm, Satish wrote:
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 Hi All! Sorry to bother, but any clues on this one? thanks Satish |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error 1004 - unable to set the hastitle property of the axis class | Excel Programming | |||
Error LineStyle property of Border Class | Excel Programming | |||
Run-time error '1004': Unable to set the CategoryNames property of the Axis class | Excel Programming | |||
Run time error 1004 - unable to get the chartObjects property of the worksheet class | Excel Programming | |||
Run time error 1004 - Unable to get add property of the buttons class | Excel Programming |