×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Excel Borders Using OLE2 from Oracle Forms
2

Excel Borders Using OLE2 from Oracle Forms

Excel Borders Using OLE2 from Oracle Forms

(OP)
Hello Again...

I have one more question regarding OLE2.  Does anyone have an example of adding borders to a specific cell in Excel, using OLE2?

Your help is much appreciated.

Thanks!!

Kelly

RE: Excel Borders Using OLE2 from Oracle Forms

(OP)
Okay,

I have figured out how to get a double line border around the entire cell, using the following code:

args    :=    OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG ( args, 16 );
OLE2.ADD_ARG ( args, 4 );
cell :=    OLE2.GET_OBJ_PROPERTY ( worksheet, 'Cells', args );
OLE2.DESTROY_ARGLIST ( args );

OLE2.SET_PROPERTY ( cell, 'ColumnWidth', 14.57 );
font :=    OLE2.GET_OBJ_PROPERTY ( cell, 'font' );
OLE2.SET_PROPERTY ( font, 'bold', true );

border    :=  OLE2.GET_OBJ_PROPERTY ( cell, 'Borders' );
OLE2.SET_PROPERTY ( border, 'LineStyle', -4119 );

OLE2.RELEASE_OBJ ( cell );

I would now like to only print this double line on the Bottom Edge of the Cell.  Does anyone have any idea how to do that?

Thanks!!

Kelly

RE: Excel Borders Using OLE2 from Oracle Forms

2
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);


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close