Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running a Word macro from Excel problem
I am trying to run a Word macro from Excel. The Macro, called DocumentSave1 is saved in the ThisDocument folder of the WrapUpTemplate file (see code). The relevant part of the code is: Dim wdApp as Word.Application Set wdApp = CreateObject("word.application") wdApp.Documents _ ..Open("P:\Spreadsheet Project\WrapUp\" & WrapUpTemplate) _ ..Application.Visible = True wdApp.Activate With wdApp ....various word coding to copy text into template (this all works fine) DocumentSave1 End with I just don't know how to get it to go to the Word macro. I have tried moving DocumentSave1 to the Modules folder, but that does not seem to work either. Any help with this would be very gratefully received, Paul -- PaulC ------------------------------------------------------------------------ PaulC's Profile: http://www.excelforum.com/member.php...fo&userid=7563 View this thread: http://www.excelforum.com/showthread...hreadid=534989 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running a Word macro from Excel problem
..Run "DocumentSave1"
"PaulC" wrote: I am trying to run a Word macro from Excel. The Macro, called DocumentSave1 is saved in the ThisDocument folder of the WrapUpTemplate file (see code). The relevant part of the code is: Dim wdApp as Word.Application Set wdApp = CreateObject("word.application") wdApp.Documents _ .Open("P:\Spreadsheet Project\WrapUp\" & WrapUpTemplate) _ .Application.Visible = True wdApp.Activate With wdApp ....various word coding to copy text into template (this all works fine) DocumentSave1 End with I just don't know how to get it to go to the Word macro. I have tried moving DocumentSave1 to the Modules folder, but that does not seem to work either. Any help with this would be very gratefully received, Paul -- PaulC ------------------------------------------------------------------------ PaulC's Profile: http://www.excelforum.com/member.php...fo&userid=7563 View this thread: http://www.excelforum.com/showthread...hreadid=534989 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running a Word macro from Excel problem
Martin Many thanks. I found it worked with just one period in front of Run: ..Run "DocumentSave1" Thanks again, Paul -- PaulC ------------------------------------------------------------------------ PaulC's Profile: http://www.excelforum.com/member.php...fo&userid=7563 View this thread: http://www.excelforum.com/showthread...hreadid=534989 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel running Word macro | Excel Discussion (Misc queries) | |||
Strange problem running Word from Excel | Excel Programming | |||
Excel macro to control Word Problem | Excel Programming | |||
running a word macro from xl | Excel Programming | |||
running a word macro from xl | Excel Programming |