Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Passing Parameters to Word from Excel
I need to pass some parameters to Word 2003 from Excel 2003. Specifically, I to want pass the path of a currently opened Excel fil to a Word macro. Here is my current code: Set WordApp = CreateObject(\"Word.Application\") 'Create ne WordApp object WordApp.Documents.Open (InspShtDOCLoc) 'Open the specific wordDoc WordApp.Visible = True 'Set the wordDOC as visible chanNum = DDEInitiate( _ app:=\"WinWord\", _ topic:=InspShtDOCLoc) test = ThisWorkbook.FullName 'Path of this Excel file WordApp.DDEExecute chanNum \"[GeneralMacros.OpenDataSourceInspect(test)]\" WordApp.DDETerminate chanNum I get the filename of the opened Excel file, pass it to a Word Macro which then sets up a Mail Merge with the Excel file path just passed t it. I get the error "Invalid Channel Number" Any changes (or even a completly different approach) would be very muc appreciated -- jake172 ----------------------------------------------------------------------- jake1729's Profile: http://www.excelforum.com/member.php...fo&userid=2726 View this thread: http://www.excelforum.com/showthread.php?threadid=47126 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Passing parameters from excel to access | Excel Programming | |||
Passing Excel Objects As Parameters | Excel Programming | |||
Passing Excel Objects As Parameters | Excel Programming | |||
Passing parameters | Excel Programming | |||
Passing parameters to UDF | Excel Programming |