Skip to Content
0
Jul 11, 2012 at 11:47 AM

Unable to upload EXCEL 7(XLSX) file in OLE coading

124 Views

Hi All,

I am facing issue while uploading a EXCEL 7(XLsX) in to our customised program but if i use EXCEL 2003(XLs) its uploading and program is proceeding.

BUt our customer is demanding for EXCEL 7(XLsX),need your valuable input.

Code:

FORM excel_open_workbook CHANGING xlapp TYPE ole2_object
xlwkbks TYPE ole2_object
xlsheet TYPE ole2_object.

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = 0
text = text-102.

CREATE OBJECT xlapp 'EXCEL.APPLICATION'.
SET PROPERTY OF xlapp 'Visible' = 0.
CALL METHOD OF xlapp 'Workbooks' = xlwkbks.
CALL METHOD OF xlwkbks 'Open' EXPORTING #1 = p_xlfil.
CALL METHOD OF xlapp 'Worksheets' = xlsheet EXPORTING #1 = p_xlsht.
CALL METHOD OF xlsheet 'Activate'.
FREE OBJECT xlwkbks.
GET PROPERTY OF xlapp 'ActiveWorkbook' = xlwkbks.

ENDFORM. " EXCEL_OPEN_WORKBOOK

Regards,

Kavya