Announcement:
wanna exchange links? contact me at sapchatroom@gmail.com.
Posted by
Admin at
Reply from wnash7658 on Jun 7 at 6:00 AM Resolved, when working with multiple sheets I had to use WA_SHEET instead of WA_MAP. Regards Waza
| | | ---------------Original Message--------------- From: wnash7658 Sent: Wednesday, June 06, 2012 7:20 AM Subject: OLE and ABAP Open With Two Worksheets and Highlight Second I have an excel file stored in SMW0 that is downloaded and opened. The second worksheet needs to be active and I pass the data into the excel and then activate the first worksheet and do the same thing. But I cannot seem to find the correct Excel OLE method to use. My code is below:- * Handles for OLE objects DATA: WA_EXCEL TYPE OLE2_OBJECT, " Excel object WA_MAPL TYPE OLE2_OBJECT, " workbooks WA_MAP TYPE OLE2_OBJECT, " workbook WA_SHEET TYPE OLE2_OBJECT, " sheet WA_BORDERS TYPE OLE2_OBJECT, " borders WA_ROWS TYPE OLE2_OBJECT, " row WA_ZL TYPE OLE2_OBJECT. " cell * Check the templete file PERFORM FRM_CHEK_DIRECTORY. * Create a new applicationl CREATE OBJECT WA_EXCEL 'EXCEL.APPLICATION'. PERFORM FRM_ERR_HDL. SET PROPERTY OF WA_EXCEL 'Visible' = 1. "open up for user to see download. * get list of workbooks, initially empty CALL METHOD OF WA_EXCEL 'Workbooks' = WA_MAPL. * OPen template file CALL METHOD OF WA_MAPL 'Open' EXPORTING #1 = P_NAME. IF SY-SUBRC NE 0. MESSAGE S398(00) DISPLAY LIKE 'E' WITH TEXT-036. LEAVE LIST-PROCESSING. ENDIF. * open Sheet. CALL METHOD OF WA_MAP " Create wsheet object 'Worksheets' = WA_SHEET EXPORTING #1 = 'Brand'. CALL METHOD OF WA_SHEET 'Activate'. It is no activating the 'Brand' worksheet. Regards Waza | | Reply to this email to post your response. __.____._ | _.____.__ |