ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   trying to DDE from Excel to Word using DDEInitiate (https://www.excelbanter.com/excel-programming/323438-trying-dde-excel-word-using-ddeinitiate.html)

Pierre Laporte

trying to DDE from Excel to Word using DDEInitiate
 
I am trying to establish a DDE link between my Excel process and a Word
process.

Even thought I have openned Word I can't seem to be able to create a
channel. Here is my code in VB.

I am using Office 2000 on WindowsXp Pro.

I did executed the following Macro and Winword|System is listed among
available processes but channelNumber in AppelFrame is always 0.

Sub Initiate_DDE()
Dim ChanNum As Long

ChanNum = Application.DDEInitiate("", "")

End Sub

Any help appreciated.
__________________________________________________ ______________________________

Public Function AppelFrame() As Boolean

Dim channelNumber As Long, returnList As Variant, i As Integer
Dim err_no As Integer

On Error GoTo Err_AppelFrame

AppelFrame = False
channelNumber = Application.DDEInitiate( _
app:="Winword", topic:="System")
If channelNumber Then
returnList = Application.DDERequest(channelNumber, "Topics")
For i = LBound(returnList) To UBound(returnList)
Worksheets("Sheet1").Cells(i, 1).Formula = returnList(i)
Next i
Application.DDETerminate channelNumber

AppelFrame = True
Else
err_no = DDEAppReturnCode()
End If

Exit_AppelFrame:
Exit Function

Err_AppelFrame:
MsgBox Err.Description
AppelFrame = False
Resume Exit_AppelFrame:
End Function




All times are GMT +1. The time now is 11:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com