View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Step through a Word macro called from Excel?

Try this

Sub test()
Dim oApp As Word.Application
On Error Resume Next
Set oApp = GetObject(, "Word.Application")
If Err < 0 Then
Set oApp = CreateObject("Word.Application")
End If

oApp.Activate
oApp.Visible = True
oApp.Documents.Add

'do things

'oApp.ActiveDocument.Close wdDoNotSaveChanges
'oApp.Quit

Set oApp = Nothing
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Ed" wrote in message ...
I have a Word 2000 template with an AutoNew macro. This is called by a
macro in Excel. I need to make some changes to the Word macro, but I can't
seem to figure out how to step through it to see what's happening. I can
step through the Excel macro, but when it hits
Set WD = CreateObject("Word.Application")
WD.Documents.Add
the Word document and actions are invisible, and I can't see the steps.

Any suggestions?

Ed