Skip to Content
author's profile photo Former Member
Former Member

excel.application? Help

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Aug 28, 2007 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 28, 2007 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2007 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2007 at 01:05 PM

    Hi

    Check this tx DWDM, there u have many examples about integration ole.

    Reward points

    Regards

    Gregory

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.