Skip to Content
0
Feb 25, 2010 at 08:55 AM

OO Excel: i_oi_spreadsheet invisible?

661 Views

Hi!

Is there a way to make the OO Excel object (class i_oi_spreadsheet) invisible and working without container? As far as I know, I must initialize control with a container (obligatory parameter). I am using a workaround: I pass default container CL_GUI_CONTAINER=>SCREEN0, so if I don't create any screen user sees nothing:

    DATA:
      lo_control       TYPE REF TO i_oi_container_control,
      lo_doc_proxy     TYPE REF TO i_oi_document_proxy,
      lo_spreadsheet   TYPE REF TO i_oi_spreadsheet.
*   create Excel document proxy
    c_oi_container_control_creator=>get_container_control(
           IMPORTING
             control              = lo_control ).
    lo_control->init_control(
             inplace_enabled      = 'X'
             r3_application_name  = 'EXCEL CONTAINER'
             parent               = cl_gui_container=>screen0 ).
    lo_control->get_document_proxy(
           EXPORTING
             document_type        = soi_doctype_excel_sheet
           IMPORTING
             document_proxy       = lo_doc_proxy ).

This works, but it is a workaround because container object is still created. Is there a proper way to make Excel object invisible?

I know that it is possible with old OLE2 interface:

SET PROPERTY OF e_appl 'VISIBLE' = 0.

Therefore, I think it should be possible with OO spreadsheet too.

Thanks!

KR,

Igor