Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing parameters from excel to access Jabeen Excel Programming 2 April 5th 05 12:33 PM
Passing Excel Objects As Parameters Jake Marx[_3_] Excel Programming 0 September 17th 04 04:25 PM
Passing Excel Objects As Parameters MDW Excel Programming 0 September 17th 04 04:17 PM
Passing parameters Eleanor[_2_] Excel Programming 0 February 4th 04 05:21 PM
Passing parameters to UDF mbobro[_3_] Excel Programming 5 January 2nd 04 04:25 PM


All times are GMT +1. The time now is 01:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"