2008 Jul 02 12:09 PM
Hi
I am generating the excel using OLE and in excel i want ot use replace staement for a column . I want to write the code for that . In excel macro i found some code for that and it is mentioned below
Selection.Replace What:="'", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
I have convert this in ABAP but it is not working Please find the code in abap
CALL METHOD OF gs_cells_temp 'Replace'
EXPORTING
#1 = '1'
#2 = ' 2'
#3 = 2
#4 = 1
#5 = 'False'
#6 = 'False'
#7 = 'False'.
Can anyone help me in this regard.
2010 Jul 19 1:47 PM
2012 Oct 17 1:49 PM
Hi Amit,
I am facing the same issue, can you advice?
Thanks in advance,
Hung
2021 Jul 20 3:58 PM
I know this is a very 'early' reply, but I was searching for the same solution.
Finally managed it myself. The solution could help others as well.
data: lo_xl_activesheet type ole2_object.
data: lo_xl_allcells type ole2_object.
data: lo_xl_activecell type ole2_object.
" lo_xl_activesheet is set to a worksheet using WORKSHEETS
call method of lo_xl_activesheet 'CELLS' = lo_xl_allcells.
call method of lo_xl_allcells 'FIND' = lo_xl_activecell
EXPORTING
#1 = '<<name_01_01>>'.
call method of lo_xl_activecell 'REPLACE'
EXPORTING
#1 = '<<name_01_01>>'
#2 = 'NewValue'.