Application Development 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: 

How to use DOI retain excel formula

0 Kudos

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.

1 REPLY 1

Sandra_Rossi
Active Contributor
0 Kudos

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.