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

How to put READONLY functionality for EXCEL in OLE2_OBJECT

Former Member
0 Likes
1,447

Hi,

i want to put 'READONLY' functionality while i download data into excel.

i'm using OLE2_OBJECT to download data and other formating stuff.

Please let me know how to put readonly option with example code.

Hi,

i want to put 'READONLY' functionality while i download data into excel.

i'm using OLE2_OBJECT to download data and other formating stuff.

Please let me know how to put readonly option with example code.

3 REPLIES 3
Read only

Former Member
0 Likes
1,202

Hi,

You can use the method FILE_SET_ATTRIBUTES of class CL_GUI_FRONTEND_SERVICES. The parameter READONLY can be used for the purpose.

http://help.sap.com/saphelp_tm80/helpdata/en/4f/09e5682e794e1185a29b19646b9873/content.htm

Read only

Former Member
0 Likes
1,202

Hi,

Use the following statements for READONLY

CALL METHOD OF w_excel1 'Columns' = w_columns.

SET PROPERTY OF w_columns 'Locked' = 0.

Read only

0 Likes
1,202

Hi Ravi,

i tried but it is doing anything.

it still allow to change columns.

below is d code:

CALL METHOD OF e_appl 'Columns' = COLUMN.

set PROPERTY OF COLUMN 'Locked' = 0.

CALL METHOD OF COLUMN 'Autofit'.

free object COLUMN.

call method of e_work 'SAVEAS'

EXPORTING

#1 = p_file

#2 = 1