This content has been marked as final. Show 2 replies
What is a parameter P_OLE_OBJECT? I think, It's a worksheet object. Am I right?
1. But there isn't the Borders property in Worksheet objects. You can use the Borders property just with Range objects.
2. Index of object in the Borders collection isn't a cell number. It can be one of the following Excell constants: xlInsideHorizontal, xlInsideVertical, xlDiagonalDown, xlDiagonalUp, xlEdgeBottom, xlEdgeLeft, xlEdgeRight, or xlEdgeTop. You can use the Cells property of a Worksheet object to get the Range object for the cell.
Try to use following code (I suppress variable declaration and importless code):
-- Get the Range object for the cell
OLE2.ADD_ARG( args, ROW );
OLE2.ADD_ARG( args, COL );
MyRange:=OLE2.GET_OBJ_PROPERTY(MySheet, 'Cells', args );
-- Get the Borders object
MyBorders:=OLE2.GET_OBJ_PROPERTY( MyRange, 'Borders' );
-- Set the LineStyle property (for all borders)
-- xlContinuous 1
-- xlLineStyleNone -4142
-- xlDash -4115
OLE2.SET_PROPERTY( MyBorders, 'LineStyle', 1 );
How to set either of left / right / top / bottom border of cell ?