LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Poking Excel data into a Word Documnet

I am trying to write a program in Excel that will work
with a Word document to create a letter with various
variables calculated in the excel workbook. I tried using
the DDE Initiate and Poke commands(I found these in a box
by John Walkenback - excel for win 95 power programing
with VBA) but it doesn't seem to work. Code I'm using is
below. Everytime I run it I first get a message box
saying "remote data not accessible, start application
WinWord.exe" I choose yes then get an error code 13, type
mismatch and the progam stops at the DDEInitiate line.


Sub Macro2()
'
' Macro2 Macro
' Macro recorded 11/13/2003 by James
'

IName = Sheets("sheet1").Range("b1")
ITitle = Sheets("sheet1").Range("b2")
Borrower = Sheets("sheet1").Range("b3")
Baddress = Sheets("sheet1").Range("b4")
BankName = Sheets("sheet1").Range("b5")
Sal = Sheets("sheet1").Range("b6")
BkAbrv = Sheets("sheet1").Range("b7")
BAbrv = Sheets("sheet1").Range("b8")
LoanType = Sheets("sheet1").Range("b9")
LoanAmt = Sheets("sheet1").Range("b10")

cfile = Application.GetSaveAsFilename & ".doc"
channel1 = DDEInitiate("WinWord.exe", cfile)

DDEPoke channel1, "IName", IName
DDEPoke channel1, "ITitle", ITitle
DDEPoke channel1, "Borrower", Borrower
DDEPoke channel1, "BAddress", Baddress
DDEPoke channel1, "BankName", BankName
DDEPoke channel1, "Sal", Sal
DDEPoke channel1, "BkAbrv", BkAbrv
DDEPoke channel1, "BAbrv", BAbrv

DDETerminate channel1

Application.ActivateMicrosoftApp xlMicrosoftWord


End Sub


It may be that I am running Office / excel 2000 but it
seems like there should be some way to pass information
from excel to word.

Can anyone help me??
 
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
Copy excel data (inc. textbox data) into Word Sarah (OGI) Excel Discussion (Misc queries) 0 August 14th 07 05:00 PM
Transfer Excel data into Word, including text box data Sarah (OGI) Excel Discussion (Misc queries) 0 July 13th 07 10:06 AM
I want to convert word column data to excel row data to sort addre craywill Excel Discussion (Misc queries) 0 April 18th 06 07:16 PM
Need help getting data from Word to Excel JM Excel Discussion (Misc queries) 4 January 4th 06 03:13 AM
Print labels by using Excel data in a Word mail into word Zoey Excel Discussion (Misc queries) 1 November 1st 05 09:08 PM


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

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

About Us

"It's about Microsoft Excel"