Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Lock boxes in ole2_object

Former Member
0 Likes
1,049

How can I insert "lock boxes" in ole2_object?  

CREATE OBJECT excel 'Excel.Application'.  

IF sy-subrc NE 0.    

  stop.  

Endif.  

Set Property excel OF 'Visible' = 0.

CALL METHOD OF excel 'Workbooks' = workbook.  

CALL METHOD OF workbook 'Add'       = map.

......

Insert the value

........ ......  

CALL METHOD OF EXCEL 'Columns' = COLUMN.  

CALL METHOD OF COLUMN 'Autofit'. ........

LOCK BOXES??????????????

Thanks.

CV

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,015

Hi cristiano,

use below code to lock cell

CALL METHOD OF h_excel 'Cells' = h_cell

     EXPORTING

     #1 = i    row number

     #2 = j.   column number

   SET PROPERTY OF h_cell 'FreezePanes' = 1.

Thanks,

Ashwath.

How can I insert "lock boxes" in ole2_object?  

CREATE OBJECT excel 'Excel.Application'.  

IF sy-subrc NE 0.    

  stop.  

Endif.  

Set Property excel OF 'Visible' = 0.

CALL METHOD OF excel 'Workbooks' = workbook.  

CALL METHOD OF workbook 'Add'       = map.

......

Insert the value

........ ......  

CALL METHOD OF EXCEL 'Columns' = COLUMN.  

CALL METHOD OF COLUMN 'Autofit'. ........

LOCK BOXES??????????????

Thanks.

CV

3 REPLIES 3
Read only

Former Member
0 Likes
1,015

Are you talking about Protecting cells?

If yes, then check this link.

http://scn.sap.com/message/712260

Thanks,
Shambu

Read only

0 Likes
1,015

Ciao Shambu, I do this:

Thanks a lot.

Read only

Former Member
0 Likes
1,016

Hi cristiano,

use below code to lock cell

CALL METHOD OF h_excel 'Cells' = h_cell

     EXPORTING

     #1 = i    row number

     #2 = j.   column number

   SET PROPERTY OF h_cell 'FreezePanes' = 1.

Thanks,

Ashwath.