Need some VB help. (Or get this example to work...)

BChico

Platinum Member
May 27, 2000
2,742
0
71
I need to be able to get CSVs from Yahoo finance and dump it into a file. I couldnt find any good examples on Google. Has anyone worked with this?

I think its something that is pretty common, so I was just checking to see if anyone had anything i could use.

Thanks
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Very easy to get working.

Open Notepad, copy the attached code in to a file and save it as yahoo-stockquote.frm.

Make a new standard project in VB6. Remove the new form it automatically gives you. Load the components dialog and add MSINET.ocx ("Microsoft Internet Transfer Control"). Then load in yahoo-stockquote.frm to your empty project. Run it, and change Startup Object to Form1 if asked.

It had given you crap about LBound/UBound because you didn't have an array of textboxes. Any txtSymbol(x) textbox you create will be added to the loop in which to retrieve stocks. I made four in this example. Then I just created the other obligatory objects and set txtQuotes (receiver) to MultiLine=True so it can accept multiple lines of text. The txtSymbol textboxes are set to default to stocks Microsoft Corporation, ATI Technologies Inc., NVIDIA Corporation, and AMD.
 

BChico

Platinum Member
May 27, 2000
2,742
0
71
Originally posted by: xtknight
Very easy to get working.

Open Notepad, copy the attached code in to a file and save it as yahoo-stockquote.frm.

Make a new standard project in VB6. Remove the new form it automatically gives you. Load the components dialog and add MSINET.ocx ("Microsoft Internet Transfer Control"). Then load in yahoo-stockquote.frm to your empty project. Run it, and change Startup Object to Form1 if asked.

It had given you crap about LBound/UBound because you didn't have an array of textboxes. Any txtSymbol(x) textbox you create will be added to the loop in which to retrieve stocks. I made four in this example. Then I just created the other obligatory objects and set txtQuotes (receiver) to MultiLine=True so it can accept multiple lines of text. The txtSymbol textboxes are set to default to stocks Microsoft Corporation, ATI Technologies Inc., NVIDIA Corporation, and AMD.



Thanks! Im not the best at VB...
 

BChico

Platinum Member
May 27, 2000
2,742
0
71
Originally posted by: xtknight
Very easy to get working.

Open Notepad, copy the attached code in to a file and save it as yahoo-stockquote.frm.

Make a new standard project in VB6. Remove the new form it automatically gives you. Load the components dialog and add MSINET.ocx ("Microsoft Internet Transfer Control"). Then load in yahoo-stockquote.frm to your empty project. Run it, and change Startup Object to Form1 if asked.

It had given you crap about LBound/UBound because you didn't have an array of textboxes. Any txtSymbol(x) textbox you create will be added to the loop in which to retrieve stocks. I made four in this example. Then I just created the other obligatory objects and set txtQuotes (receiver) to MultiLine=True so it can accept multiple lines of text. The txtSymbol textboxes are set to default to stocks Microsoft Corporation, ATI Technologies Inc., NVIDIA Corporation, and AMD.

If i want to throw this into another form i already have, what would be the best way to do that?