Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, Ron - but I'm a bit lost in using this. Is this a separate Excel
Sub to allow me to walk through my template code? Or should I put this in my existing Excel code? Ed "Ron de Bruin" wrote in message ... 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The Excel sub open Word and make it visible and add a document for you
the Word document and actions are invisible You can see your Word document now with oApp.Activate oApp.Visible = True It will not walk through your Word template code You must do that in Word VBA -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Ed" wrote in message ... Thanks, Ron - but I'm a bit lost in using this. Is this a separate Excel Sub to allow me to walk through my template code? Or should I put this in my existing Excel code? Ed "Ron de Bruin" wrote in message ... 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you. I'll work with this. I appreciate the help.
Ed "Ron de Bruin" wrote in message ... The Excel sub open Word and make it visible and add a document for you the Word document and actions are invisible You can see your Word document now with oApp.Activate oApp.Visible = True It will not walk through your Word template code You must do that in Word VBA -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Ed" wrote in message ... Thanks, Ron - but I'm a bit lost in using this. Is this a separate Excel Sub to allow me to walk through my template code? Or should I put this in my existing Excel code? Ed "Ron de Bruin" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need step by step to add invoice numbering to excel template | New Users to Excel | |||
How to change the macro called by an add in from older excel? | Excel Discussion (Misc queries) | |||
Excel 2000 Step By Step. What URL to use in Lesson 8? | New Users to Excel | |||
I need step by step instructions to create a macro for 10 imbedde. | Excel Worksheet Functions | |||
Called macro runs twice in excel 2002 | Excel Programming |