Hi All,
I am experiencing the following error when trying to execute this snippet of code:-
Run-Time Error 1004: Unable to set the LineStyle property of the Border class
It errors at the highlighted line above (xlEdgeTop).
I have tried numerouse things, but cannot figure it out. Have used this with With statements, moved the offending statement up and down the code, but to no avail.
The Excel cell I am trying to format is in the centre of the spreadsheet. ALl the other borders are fine, but this one doesn't want to know!
Thanks in advance,
Paul.
I am experiencing the following error when trying to execute this snippet of code:-
Run-Time Error 1004: Unable to set the LineStyle property of the Border class
Code:
[B]appXL.Selection.Borders(xlEdgeTop).LineStyle = xlContinuous[/B]
appXL.Selection.Borders(xlEdgeLeft).LineStyle = xlContinuous
appXL.Selection.Borders(xlDiagonalDown).LineStyle = xlNone
appXL.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
appXL.Selection.Borders(xlEdgeBottom).LineStyle = xlNone
appXL.Selection.Borders(xlEdgeRight).LineStyle = xlNone
appXL.Selection.Borders(xlInsideVertical).LineStyle = xlNone
appXL.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
It errors at the highlighted line above (xlEdgeTop).
I have tried numerouse things, but cannot figure it out. Have used this with With statements, moved the offending statement up and down the code, but to no avail.
The Excel cell I am trying to format is in the centre of the spreadsheet. ALl the other borders are fine, but this one doesn't want to know!
Thanks in advance,
Paul.