Wednesday, 22 February 2017
ABAP OLE Programming for Excel
DATA: h_excel TYPE ole2_object, " Excel object
h_mapl TYPE ole2_object, " list of workbooks
h_map TYPE ole2_object, " workbook
v_filename TYPE string VALUE 'C:\Users\phoonookan\Desktop\1111.xlsx'.
CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
SET PROPERTY OF h_excel 'Visible' = 1.
CALL METHOD OF h_excel 'Workbooks' = h_mapl.
CALL METHOD OF h_mapl 'Open' = h_map
EXPORTING
#1 = v_filename.
*CALL METHOD OF h_map 'PrintOut'.
CALL METHOD OF h_map 'PrintPreview'.
CALL METHOD OF h_mapl 'Close'.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment