Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
SAP Community Downtime Scheduled for This Weekend

OLE

Former Member
0 Kudos
78

Hi

I have defined

data: lw_templ_wbook TYPE ole2_object.

CALL METHOD OF lw_templ_wbook 'SAVE'.

IF sy-subrc >< 0.

PERFORM f800_append_message USING text-e07

CHANGING gf_error gi_msg.

EXIT.

ENDIF.

here I am getting sy-subrc eq 2.

what can be cause and how to correct it.

Moderator message: please use more descriptive subject lines from now on.

Edited by: Thomas Zloch on Oct 28, 2010 3:30 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos
45

data: go_excel type ole2_object,

go_workbook TYPE OLE2_OBJECT,

****INITIATE EXCEL

  • Create object Excel

create object go_excel 'EXCEL.APPLICATION'.

set property of go_excel 'Visible' = 0.

  • Create workbook object

call method of go_excel 'WORKBOOKS' = go_workbook .

  • Add workbook

call method of go_workbook 'Add' = go_workbook.

**CLOSE EXCEL**********

CALL METHOD OF go_workbook 'SaveAs'

EXPORTING #1 = gv_file

#2 = 1.

3 REPLIES 3

Former Member
0 Kudos
46

data: go_excel type ole2_object,

go_workbook TYPE OLE2_OBJECT,

****INITIATE EXCEL

  • Create object Excel

create object go_excel 'EXCEL.APPLICATION'.

set property of go_excel 'Visible' = 0.

  • Create workbook object

call method of go_excel 'WORKBOOKS' = go_workbook .

  • Add workbook

call method of go_workbook 'Add' = go_workbook.

**CLOSE EXCEL**********

CALL METHOD OF go_workbook 'SaveAs'

EXPORTING #1 = gv_file

#2 = 1.

Former Member
0 Kudos
45

Done

0 Kudos
45

Hi Suchender,

<removed by moderator>

Thank you

Jan

Edited by: Thomas Zloch on Oct 29, 2010 5:26 PM - please do not ask for ...