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: 

Error in OLE2 Object when using Open method

Former Member
0 Kudos

Hi,

When calling Method OPEN I've got a SY-SUBRC = 2, I'm trying to open an excel sheet that has been imported from the server to my pc, through the same report that's giving me trouble.

The thing is that in DEV client it works perfectly, but in PRD client won't.

I've checked User privileges and they're Ok, and tried it with different users too.

Here's the code:

*Abre Objeto EXCEL*
  CREATE OBJECT go_excel 'Excel.Application'.               "#EC NOTEXT
  IF sy-subrc NE 0.
    MESSAGE e000(38) WITH 'No se pudo iniciar un objeto'.
  ENDIF.

*Para que no muestre alertas o warnings*
  SET PROPERTY OF go_excel 'DisplayAlerts' = 0.             "#EC NOTEXT
  CALL METHOD OF go_excel 'WORKBOOKS' = go_workbook.

*Excel en fondo*
  SET PROPERTY OF go_excel 'Visible' = 0.                   "#EC NOTEXT

*Llamamos un libro excel*
  CALL METHOD OF go_workbook 'OPEN'
    EXPORTING #1 = gs_excel_temp.

Regards,

FChavez

Edited by: Rob Burbank on May 13, 2010 5:38 PM

2 REPLIES 2

JerryWang
Advisor
Advisor
0 Kudos

Hello FChavez,

Perhaps you can first check in your PROD system whether excel is installed correctly there?

or you can run test report SAPRDEMOEXCELINTEGRATION in PROD to see that report works or not...

Best Regards,

Jerry

Former Member
0 Kudos

Run the rest and did work.

So we realized that the template wasn't properly uploaded.

Thanks!

FChavez

Edited by: Fiorella Chavez Valdivia on Dec 17, 2010 3:23 PM