borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Shell )Next Topic (VB Project Mapper) New Topic New Poll Post Reply
AndreaVB Forum : VB General : using DDE to display stock quote
Poster Message
alex
Level: Guest


icon using DDE to display stock quote  Archived to Disk

I'm trying to write a simple VB application which will access the stock quote. I don't know how to do it. I'm not a VB  programmer, but I can understand and write simple stuff.

I made a form with a text box and here is the code.
Private Sub Form_Load()
   Dim s As String
   Dim a As Single
   s = "Iquote|last!ATH"
' s = STIDDE|Q!'C.N,1'
   Text1.LinkRequest
   Text1.LinkItem = s
   a = s
   Text1.Text = Str(a)
End Sub

I do a test run and got error message:
"DDE method invoked with no channel open"

Can someone please help me?

Thanks

09-06-2002 at 07:06 AM
| Quote Reply
shahidmojid
Level: Professor

Registered: 09-05-2002
Posts: 85
icon Re: using DDE to display stock quote  Archived to Disk

Hi Alex,
How come you r updating your text box before link. See this example, it might help you:

Private Sub Form_Click()
   If Text1.LinkMode = vbNone Then   ' Test link mode.
      Text1.LinkTopic = "Excel|Sheet1"   ' Set link topic.
      Text1.LinkItem = "R1C1"   ' Set link item.
      Text1.LinkMode = vbLinkManual   ' Set link mode.
      Text1.LinkRequest   ' Update text box.
   Else
      If Text1.LinkItem = "R1C1" Then
         Text1.LinkItem = "R2C1"
         Text1.LinkRequest   ' Update text box.
      Else
         Text1.LinkItem = "R1C1"
         Text1.LinkRequest   ' Update text box.
      End If
   End If
End Sub

09-06-2002 at 12:56 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : using DDE to display stock quote
Previous Topic (Shell )Next Topic (VB Project Mapper) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder