Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem editing Word document with VBA from Excel
Sorry - posted too soon
I have just discovered that this is a known bug - Microsoft Knowledge Base Article - 292744 - and you can get round it by using late binding Malone "Malone" wrote in message ... I am trying to find and replace words in a Word document from Excel using VBA. The following code gives me an error message - method 'execute' of object 'find' failed I can get similar code to work using VBA from within the Word Application but not when I use it from Excel. Can someone tell me what elementary error I am making? Using XP with Excel 2002 SP-2. Thanks Sub editword() Dim objWD As Word.Application Dim wrdDoc As Word.Document Set objWD = CreateObject("Word.Application") Set wrdDoc = objWD.Documents.Open("C:\Documents and Settings\admin\My Documents\worddoc.doc") objWD.Visible = True objWD.Selection.Find.Execute FindText:="image", ReplaceWith:="picture" objWD.Quit Set wrdDoc = Nothing Set objWD = Nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
convert excel document to word document (not a picture) | Excel Discussion (Misc queries) | |||
Excel document locked for editing? | Excel Discussion (Misc queries) | |||
excel document locked for editing | Setting up and Configuration of Excel | |||
Problem with linked Excel table in a word Document | Excel Discussion (Misc queries) | |||
Hyperlink to word document problem | Links and Linking in Excel |