Calling Excel OLE Methods from the Universal Work List
SAP_WUG@acdi-cida.gc.ca
SAP_WUG at acdi-cida.gc.ca
Tue Jun 6 16:10:54 EDT 2006
Hello to all of you WUG members,
I am trying to edit an excel file from the portal (it starts as a work item
from the Universal Work List). I'm using the OLE interface as follows:
********************************************************
CREATE OBJECT excel 'Excel.Application'.
CALL METHOD OF excel 'Workbooks' = workbook.
CALL METHOD OF workbook 'Open'
EXPORTING
#1 = filename.
SET PROPERTY OF excel 'Visible' = 0.
CONCATENATE firstname lastname INTO cons SEPARATED BY space.
CALL METHOD OF excel 'CELLS' = cell
EXPORTING
#1 = 4
#2 = 2.
SET PROPERTY OF cell 'VALUE' = cons no flush.
//Lots of code for cell editing and then Save
CALL METHOD OF workbook 'Save'.
IF sy-subrc = 0.
filename_out = filename.
ENDIF.
//Some clean up
**************************************************
This code works perfectly when run within R/3 but from the portal I get a
sy-subrc = 2 when calling 'Open'. This excel file is saved on the user's
local directory.
We are currently using EP 6, R/3 4.7 and Windows XP as the user's frontend.
I've been able to open the document with method
cl_gui_frontend_services=>execute but I can't find any method to perform a
cell-by-cell editing of my excel document.
Your help is very much appreciated.
More information about the SAP-WUG
mailing list