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: 

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

former_member198450
Active Contributor
0 Kudos

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

1 REPLY 1

Former Member
0 Kudos

Did you try running the program ? Per my knowledge, when we use the statement "CALL OBJECT abc 'EXCEL.APPLICATION', the system will use ActiveX which will call the application in the client. So if in the client there is Office 2003, Excel 2003 will be called. And in case Office 2007 is install for the users, Excel 2007 will be called.

Regards,

Paul