Here are some examples. The contstants I use are in blue
---- LineStyle constants default is xlContinuous
xlContinuous constant number(5):= 1;
xlDash constant number(5):= -4115;
xlDashDot constant number(5):= 4;
xlDashDotDot constant number(5):= 5;
xlDot constant number(5):= -4118;
xlDouble constant number(5):= -4119;
xlLIneStyleNone constant number(5):= -4142;
xlSlantDashDot constant number(5):= 13;
---- Weight constants default is xlThin
xlHairline constant number(5):= 1;
xlThin constant number(5):= 2;
xlMedium constant number(5):= -4138;
xlThick constant number(5):= 4;
---- Borders Index constants default is xlThin
xlDiagonalDown constant number(5):= 5;
xlDiagonalUp constant number(5):= 6;
xlEdgeBottom constant number(5):= 9;
xlEdgeLeft constant number(5):= 7;
xlEdgeRight constant number(5):= 10;
xlEdgeTop constant number(5):= 8;
xlInsideHorizontal constant number(5):= 12;
xlInsideVertical constant number(5):= 11;
-----------------------------------
----Set Border part for cell E8----
-----------------------------------
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, '8');
OLE2.ADD_ARG(args, 'E');
cell := OLE2.GET_OBJ_PROPERTY(worksheet, 'Cells', args);
OLE2.DESTROY_ARGLIST(args);
args:= ole2.create_arglist;
ole2.add_arg(args, xlDiagonalDown);
borders := OLE2.GET_OBJ_PROPERTY(cell, 'Borders', args);
OLE2.DESTROY_ARGLIST(args);
OLE2.SET_PROPERTY(borders, 'LineStyle', xlDash);
OLE2.SET_PROPERTY(borders, 'Weight', xlThin);
OLE2.SET_PROPERTY(borders, 'ColorIndex', 4);
OLE2.RELEASE_OBJ(borders);
args:= ole2.create_arglist;
ole2.add_arg(args, xlEdgeLeft);
borders := OLE2.GET_OBJ_PROPERTY(cell, 'Borders', args);
OLE2.DESTROY_ARGLIST(args);
OLE2.SET_PROPERTY(borders, 'LineStyle', xlDashDotDot);
OLE2.SET_PROPERTY(borders, 'Weight', xlThin);
OLE2.SET_PROPERTY(borders, 'ColorIndex', 3);
OLE2.RELEASE_OBJ(borders);
args:= ole2.create_arglist;
ole2.add_arg(args, xlEdgeBottom);
borders := OLE2.GET_OBJ_PROPERTY(cell, 'Borders', args);
OLE2.DESTROY_ARGLIST(args);
OLE2.SET_PROPERTY(borders, 'LineStyle', xlDouble);
OLE2.SET_PROPERTY(borders, 'Weight', xlThin);
OLE2.SET_PROPERTY(borders, 'ColorIndex', 5);
OLE2.RELEASE_OBJ(borders);
OLE2.RELEASE_OBJ(cell);
------------------------------------
----Set Border whole for cell C8----
------------------------------------
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, '8');
OLE2.ADD_ARG(args, 'C');
cell := OLE2.GET_OBJ_PROPERTY(worksheet, 'Cells', args);
OLE2.DESTROY_ARGLIST(args);
args:= ole2.create_arglist;
ole2.add_arg(args, xlContinuous);
ole2.add_arg(args, xlThick);
ole2.add_arg(args, 5);
OLE2.INVOKE(cell, 'BorderAround', args);
OLE2.RELEASE_OBJ(cell);