I
internacio
Hi all,
I am working with an application I am making. It tries to send some
data from excel to word. To do so, I make a template on word and say in
excel to find and replace some values.
The thing is that the code to find and replace works perfectly in my
computer, but when I try to do it in another one crashes and gives the
following error:
THE FOLLOWING ERROR HAS OCURRED -2147023113(8007067F) ON EXECUTION
TIME.
ERROR ON THE METHOD 'EXECUTE' OF THE OBJECT 'FIND'
The code I am using is
- Dim DocWord As Word.Document
Dim VariableWord As Word.Application
Set VariableWord = New Word.Application
Set DocWord = VariableWord.Documents.Add("I:\RIESGOS
OPERACIONALES\Sarbanes-Oxley\Aplicación sox\recomendaciones.dot")
VariableWord.Visible = False
With DocWord.Content.Find
..Execute findtext:="{texto1}", replacewith:=encabezado.Text,
Replace:=wdReplaceAll
..Execute findtext:="{texto2}", replacewith:=cuerpo1.Text,
Replace:=wdReplaceAll
..Execute findtext:="{texto3}", replacewith:=cuerpo2.Text,
Replace:=wdReplaceAll
..Execute findtext:="{texto4}", replacewith:=pie.Text,
Replace:=wdReplaceAll-
I WILL APRECIATE SOME HELP!! THANK YOU VERY MUCH
I am working with an application I am making. It tries to send some
data from excel to word. To do so, I make a template on word and say in
excel to find and replace some values.
The thing is that the code to find and replace works perfectly in my
computer, but when I try to do it in another one crashes and gives the
following error:
THE FOLLOWING ERROR HAS OCURRED -2147023113(8007067F) ON EXECUTION
TIME.
ERROR ON THE METHOD 'EXECUTE' OF THE OBJECT 'FIND'
The code I am using is
- Dim DocWord As Word.Document
Dim VariableWord As Word.Application
Set VariableWord = New Word.Application
Set DocWord = VariableWord.Documents.Add("I:\RIESGOS
OPERACIONALES\Sarbanes-Oxley\Aplicación sox\recomendaciones.dot")
VariableWord.Visible = False
With DocWord.Content.Find
..Execute findtext:="{texto1}", replacewith:=encabezado.Text,
Replace:=wdReplaceAll
..Execute findtext:="{texto2}", replacewith:=cuerpo1.Text,
Replace:=wdReplaceAll
..Execute findtext:="{texto3}", replacewith:=cuerpo2.Text,
Replace:=wdReplaceAll
..Execute findtext:="{texto4}", replacewith:=pie.Text,
Replace:=wdReplaceAll-
I WILL APRECIATE SOME HELP!! THANK YOU VERY MUCH