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: 37
Default DDE Links

I am trying to create an Excel function that will use DDE Links to pull in
information from another program. The code I have so far is:

Public Function ExternalData(symb As String, fld As String)
Dim ch As Variant, code As Variant

ch = DDEInitiate(App:="ExtSys", Topic:="Quote")
code = DDEAppReturnCode
If code < 0 Then
LiquidData = "No DDE"
Exit Function
End If
ExternalData = DDERequest (channel:=ch, item:=symb)
code = DDEAppReturnCode
If code < 0 Then
ExternalData = "DDE Failure"
Exit Function
End If
DDETerminate Channel:=ch

End Function

I'm brand new to using DDE links in VBA so I'm not sure where I've gone
wrong, but the function results in the value "FALSE" when it should be a
numeric value. Also when I look in the Links Editor, it does not appear any
DDE Links have been established, even when I comment out the DDETerminate in
the code. I've tried replacing the DDERequest with the function that is
normall used in the spreadsheet to pull in data from the external system -
Evaluate ("=ExtSys|" & fld & "!" & symb) - but because I can't seem to
establish the DDE links, this just results in a "N/A" error. Any tips on how
I can make this work? I realize it's a difficult question to field without
knowing the system Excel is going out to.

Thanks for the help!
 
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
Slow opening links between workbooks with links created in 2003 Russell Excel Discussion (Misc queries) 0 December 14th 09 02:59 PM
Update links box gives Continue or Edit Links dialog KarenF Excel Discussion (Misc queries) 0 May 18th 07 01:17 PM
Edit Links: Changing links on a protected worksheet Halibut68 Excel Discussion (Misc queries) 0 April 28th 06 11:03 AM
Relative Links becoming Absolute Links? GB Excel Programming 0 October 3rd 05 07:05 PM
EXCEL - LINKS cannot easily get list of all links & names in book Tuba Joe Excel Worksheet Functions 1 September 29th 05 10:33 PM


All times are GMT +1. The time now is 05:46 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"