S
Sathya
How can I pass a value from Excel to Word which is stored in a
variable?
How can this be done using Macros?
I have a problem in the following code
For Example :-
Macro in Excel
-----------------
Sub DDEtoWordOld()
Dim chanNum As Variant
Dim test As String
test = "Value"
chanNum = DDEInitiate("WinWord", "System")
DDEExecute chanNum, "[DDETesting.Test(""Value"")]"
DDEExecute chanNum, "[DDETesting.Test(test)]"
DDETerminate chanNum
End Sub
Macro in Word -Module name -DDETesting
-----------------------------------------
Sub test(Test As String)
MsgBox "The value is: " & Test
End Sub
DDEExecute chanNum, "[DDETesting.Test(""Value"")]" -This line of code
works perfectly when a string is passed directly as a parameter.
DDEExecute chanNum, "[DDETesting.Test(' " & test & " ')]" -This line
gives a "Syntax error" during run time in a dynamically created macro
WordTmpDDEMod
Sub TmpDDE()
WordBasic.Call "DDETesting.Test",'value' ------SYNTAX ERROR in
this line
End Sub
Can anyone help me out in knowing How this variable should be
passed???
variable?
How can this be done using Macros?
I have a problem in the following code
For Example :-
Macro in Excel
-----------------
Sub DDEtoWordOld()
Dim chanNum As Variant
Dim test As String
test = "Value"
chanNum = DDEInitiate("WinWord", "System")
DDEExecute chanNum, "[DDETesting.Test(""Value"")]"
DDEExecute chanNum, "[DDETesting.Test(test)]"
DDETerminate chanNum
End Sub
Macro in Word -Module name -DDETesting
-----------------------------------------
Sub test(Test As String)
MsgBox "The value is: " & Test
End Sub
DDEExecute chanNum, "[DDETesting.Test(""Value"")]" -This line of code
works perfectly when a string is passed directly as a parameter.
DDEExecute chanNum, "[DDETesting.Test(' " & test & " ')]" -This line
gives a "Syntax error" during run time in a dynamically created macro
WordTmpDDEMod
Sub TmpDDE()
WordBasic.Call "DDETesting.Test",'value' ------SYNTAX ERROR in
this line
End Sub
Can anyone help me out in knowing How this variable should be
passed???