07-11-2012 12:47 PM
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
07-12-2012 7:59 AM
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