class ZCL_EXCEL_READER_XLSM definition public inheriting from ZCL_EXCEL_READER_2007 final create public . public section. *"* public components of class ZCL_EXCEL_READER_XLSM *"* do not include other source files here!!! protected section. *"* protected components of class ZCL_EXCEL_READER_XLSM *"* do not include other source files here!!! methods LOAD_WORKBOOK redefinition . methods LOAD_WORKSHEET redefinition . private section. *"* private components of class ZCL_EXCEL_READER_XLSM *"* do not include other source files here!!! methods LOAD_VBAPROJECT importing !IP_PATH type STRING !IP_EXCEL type ref to ZCL_EXCEL . *"* use this source file for the definition and implementation of *"* local helper classes, interface definitions and type *"* declarations *"* use this source file for any type of declarations (class *"* definitions, interfaces or type declarations) you need for *"* components in the private section *"* use this source file for any macro definitions you need *"* in the implementation part of the class METHOD load_vbaproject. DATA lv_content TYPE xstring. lv_content = me->get_from_zip_archive( ip_path ). ip_excel->zif_excel_book_vba_project~set_vbaproject( lv_content ). ENDMETHOD. METHOD load_workbook. super->load_workbook( EXPORTING ip_path = ip_path ip_excel = ip_excel ). CONSTANTS: lc_vba_project TYPE string VALUE 'http://schemas.microsoft.com/office/2006/relationships/vbaProject'. DATA: rels_workbook_path TYPE string, rels_workbook TYPE REF TO if_ixml_document, path TYPE string, node TYPE REF TO if_ixml_element, workbook TYPE REF TO if_ixml_document, stripped_name TYPE chkfile, dirname TYPE string, relationship TYPE t_relationship, fileversion TYPE t_fileversion, workbookPr TYPE t_workbookPr. FIELD-SYMBOLS: <worksheet> TYPE t_relationship. CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH' EXPORTING full_name = ip_path IMPORTING stripped_name = stripped_name file_path = dirname. " Read Workbook Relationships CONCATENATE dirname '_rels/' stripped_name '.rels' INTO rels_workbook_path. rels_workbook = me->get_ixml_from_zip_archive( rels_workbook_path ). node ?= rels_workbook->find_from_name( 'Relationship' ). WHILE node IS BOUND. me->fill_struct_from_attributes( EXPORTING ip_element = node CHANGING cp_structure = relationship ). CASE relationship-type. WHEN lc_vba_project. " Read VBA binary CONCATENATE dirname relationship-target INTO path. me->load_vbaproject( ip_path = path ip_excel = ip_excel ). WHEN OTHERS. ENDCASE. node ?= node->get_next( ). ENDWHILE. " Read Workbook codeName workbook = me->get_ixml_from_zip_archive( ip_path ). node ?= workbook->find_from_name( 'fileVersion' ). IF node IS BOUND. fill_struct_from_attributes( EXPORTING ip_element = node CHANGING cp_structure = fileversion ). ip_excel->zif_excel_book_vba_project~set_codename( fileversion-codename ). ENDIF. " Read Workbook codeName workbook = me->get_ixml_from_zip_archive( ip_path ). node ?= workbook->find_from_name( 'workbookPr' ). IF node IS BOUND. fill_struct_from_attributes( EXPORTING ip_element = node CHANGING cp_structure = workbookPr ). ip_excel->zif_excel_book_vba_project~set_codename_pr( workbookPr-codename ). ENDIF. ENDMETHOD. METHOD load_worksheet. super->load_worksheet( EXPORTING ip_path = ip_path io_worksheet = io_worksheet ). DATA: path TYPE string, node TYPE REF TO if_ixml_element, worksheet TYPE REF TO if_ixml_document, sheetPr TYPE t_sheetPr. * " Read Workbook codeName * workbook = me->get_ixml_from_zip_archive( ip_path ). * node ?= workbook->find_from_name( 'fileVersion' ). * IF node IS BOUND. * * fill_struct_from_attributes( EXPORTING ip_element = node * CHANGING cp_structure = fileversion ). * * IO_WORKSHEET->zif_excel_book_vba_project~set_codename( fileversion-codename ). * ENDIF. " Read Workbook codeName worksheet = me->get_ixml_from_zip_archive( ip_path ). node ?= worksheet->find_from_name( 'sheetPr' ). IF node IS BOUND. fill_struct_from_attributes( EXPORTING ip_element = node CHANGING cp_structure = sheetpr ). io_worksheet->zif_excel_sheet_vba_project~set_codename_pr( sheetpr-codename ). ENDIF. ENDMETHOD.