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 use DOI retain excel formula

Former Member
0 Likes
1,376

When I use DOI I_OI_SPREADSHEET->SET_RANGES_DATA to put datas to an excel template, excel formula is covered.

I want retain excel formula if zhe ranges have not data. how can i do ? Somebody can help me? Thanks

I use OAOR to upload excel template.

I guess DOI handles only simple text.

As a workaround, you may directly issue OLE statements on the DOI control, by retrieving its OLE handle.

Example:

DATA doi_control TYPE REF TO I_OI_CONTAINER_CONTROL.

c_oi_container_control_creator=>get_container_control(
    IMPORTING
      control = doi_control ).

DATA(doi_handle) = doi_control->get_control_handle( ). " type CNTL_HANDLE in type pool CNTL
DATA(ole_handle) = doi_handle-obj. " type OBJ_RECORD

CALL METHOD OF ole_handle 'method' ...

More information on CALL METHOD OF, SET PROPERTY, etc.: ABAP documentation of OLE statements

Now, what you have to do is to ask in Microsoft forums what are the methods and properties to access the formulas. You may try by yourself using the VBA editor in Excel.

1 REPLY 1
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,121

I guess DOI handles only simple text.

As a workaround, you may directly issue OLE statements on the DOI control, by retrieving its OLE handle.

Example:

DATA doi_control TYPE REF TO I_OI_CONTAINER_CONTROL.

c_oi_container_control_creator=>get_container_control(
    IMPORTING
      control = doi_control ).

DATA(doi_handle) = doi_control->get_control_handle( ). " type CNTL_HANDLE in type pool CNTL
DATA(ole_handle) = doi_handle-obj. " type OBJ_RECORD

CALL METHOD OF ole_handle 'method' ...

More information on CALL METHOD OF, SET PROPERTY, etc.: ABAP documentation of OLE statements

Now, what you have to do is to ask in Microsoft forums what are the methods and properties to access the formulas. You may try by yourself using the VBA editor in Excel.