08-28-2007 12:54 PM
Hi everyboy!
I need to download some data with
CREATE OBJECT h_excel 'Excel.Application'.
SET PROPERTY OF h_excel 'Visible' = 1.
GET PROPERTY OF h_excel 'Workbooks' = h_map.
CALL METHOD OF h_map 'Workbooks' = h_map.
open existing workbook
call method of h_map 'Open' = rc
exporting #1 = p_file.
PERFORM err_hdl.
In p_file is my excel form (f.e. c:\Pool.xls)
But i can't open this excel form!
Please gimme some help (its urgent)
thanks
Thomas
08-28-2007 3:34 PM
I suggest that you use classes for Office integration in place of doing all this stuff by yourself
You can take a look at the sample program SAPRDEMOEXCELINTEGRATION2
08-28-2007 3:57 PM
Hi,
Try the Following
data: e_sheet type ole2_object.
data: e_appl type ole2_object.
data: e_work type ole2_object.
data: e_cell type ole2_object.
data: e_wbooklist type ole2_object.
parameters: p_file type localfile default 'C:\Test.xls'.
start-of-selection.
Start the application
create object e_appl 'EXCEL.APPLICATION'.
set property of e_appl 'VISIBLE' = 0.
Open the file
call method of e_appl 'WORKBOOKS' = e_wbooklist.
get property of e_wbooklist 'Application' = e_appl .
set property of e_appl 'SheetsInNewWorkbook' = 1 .
call method of e_wbooklist 'Add' = e_work .
get property of e_appl 'ActiveSheet' = e_sheet .
set property of e_sheet 'Name' = 'Test' .
Regards,
Lijo Joseph
08-29-2007 7:02 AM
Hi Lijo,
i tried your solution, but i always get the error message: "Fehler bei OLE-Automation: 2"
Wich means, the sy-subrc = 2.
Do you know why?
Best regards
Thomas
08-29-2007 2:05 PM
Hi
Check this tx DWDM, there u have many examples about integration ole.
Reward points
Regards
Gregory