N
not2brite
I'm trying to create a spreadsheet that when I click a button it wil
download the .csv file directly to my harddrive then I can use anothe
routine to open it after it's downloaded(or better yet open/downloa
directly) into another sheet in the workbook. My problem is I'm no
sure if, for the given site, I need to learn xml or javascript. I'v
seen many references to xml on the forums but the site appears to us
java script.
Here is a piece of code I was able to make work by reading the post
here and a book called "Excel 2000 Power Programming"
<code>
----------------------------------
Function GetDataButton()
Dim DataHere As Range
Dim msn As QueryTable
Dim address As String
Set DataHere = Worksheets("Sheet1").Range("$F1")
address = "URL;http://tinyurl.com/2r7l6"
Sheets("Sheet1").Select
Set msn = ActiveSheet.QueryTables.Add(Connection:=address
Destination:=DataHere)
msn.Refresh
End Function
----------------------------------
</code>
Please note this code DOES NOT do what I want(and the ticker symbol i
hardcoded into it) but it does link to the page where I then have th
option to save it.
My problem is I can't see for the life of me a url to the .csv file
Here's a snip:
<code>
----------------------------
<SCRIPT LANGUAGE=javascript>
<!--//
document.QlistCtl.Symbol.focus();document.QlistCtl.Symbol.select();
//-->
</SCRIPT>
</TR><TR><TD VALIGN=TOP><TABLE WIDTH=100% BORDER=0 CELLSPACING=
CELLPADDING=0><TR><TD VALIGN=TOP>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 ALIGN=LEFT WIDTH=400>
<FORM NAME=Charts ACTION=chartdl.asp METHOD=GET>
<TR>
<TD ALIGN=RIGHT WIDTH=307>
<INPUT TYPE=IMAGE name="FileDownLoadBt" SRC="images/downlbut.gif
border=0 WIDTH=90 HEIGHT=20>
</TD>
<TD WIDTH=8><SPACER TYPE=BLOCK WIDTH=8></TD>
<TD ALIGN=RIGHT WIDTH=90>
<INPUT TYPE=IMAGE name="ShowChartBt" SRC="images/showchrt.gif
border=0 WIDTH=90 HEIGHT=20>
<INPUT TYPE=HIDDEN NAME="Symbol" VALUE="mrk">
</TD>
</TR>
</FORM>
</TABLE>
<BR CLEAR=ALL>
<B>Merck & Co Inc</B>
<BR CLEAR=ALL>
<!-- Begin stock History table -->
--------------------------------
</code>
Is this line -
document.QlistCtl.Symbol.focus();document.QlistCtl.Symbol.select();
telling the page/browser what to do if either the download file butto
or show chart button is pressed? If it is then it appears I'm going t
need to get a grasp of javascript to be able to see what it's doing
Once I know that, is that where the XML stuff comes in? Basicall
trying to send the page/server/whatever info as if it came from th
webpage and the page "responds" accordingly? I glossed over a book a
the store on xml but I didn't see any refernce to working within vb
code but I could have easily missed it.
It's been 6-7 years since I've messed with html(a passing interest).
never bothered to learn vbscript or javascript. I've been using exce
for a few months to run numbers on stocks and basically cut/paste th
info I want but that's getting old. I've written some simple subs an
functions up to this point is all. I just started this project Tuesda
so I've still got alot more learning to do but that's where the fu
is.
Thanks for any input,
Bra
download the .csv file directly to my harddrive then I can use anothe
routine to open it after it's downloaded(or better yet open/downloa
directly) into another sheet in the workbook. My problem is I'm no
sure if, for the given site, I need to learn xml or javascript. I'v
seen many references to xml on the forums but the site appears to us
java script.
Here is a piece of code I was able to make work by reading the post
here and a book called "Excel 2000 Power Programming"
<code>
----------------------------------
Function GetDataButton()
Dim DataHere As Range
Dim msn As QueryTable
Dim address As String
Set DataHere = Worksheets("Sheet1").Range("$F1")
address = "URL;http://tinyurl.com/2r7l6"
Sheets("Sheet1").Select
Set msn = ActiveSheet.QueryTables.Add(Connection:=address
Destination:=DataHere)
msn.Refresh
End Function
----------------------------------
</code>
Please note this code DOES NOT do what I want(and the ticker symbol i
hardcoded into it) but it does link to the page where I then have th
option to save it.
My problem is I can't see for the life of me a url to the .csv file
Here's a snip:
<code>
----------------------------
<SCRIPT LANGUAGE=javascript>
<!--//
document.QlistCtl.Symbol.focus();document.QlistCtl.Symbol.select();
//-->
</SCRIPT>
</TR><TR><TD VALIGN=TOP><TABLE WIDTH=100% BORDER=0 CELLSPACING=
CELLPADDING=0><TR><TD VALIGN=TOP>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 ALIGN=LEFT WIDTH=400>
<FORM NAME=Charts ACTION=chartdl.asp METHOD=GET>
<TR>
<TD ALIGN=RIGHT WIDTH=307>
<INPUT TYPE=IMAGE name="FileDownLoadBt" SRC="images/downlbut.gif
border=0 WIDTH=90 HEIGHT=20>
</TD>
<TD WIDTH=8><SPACER TYPE=BLOCK WIDTH=8></TD>
<TD ALIGN=RIGHT WIDTH=90>
<INPUT TYPE=IMAGE name="ShowChartBt" SRC="images/showchrt.gif
border=0 WIDTH=90 HEIGHT=20>
<INPUT TYPE=HIDDEN NAME="Symbol" VALUE="mrk">
</TD>
</TR>
</FORM>
</TABLE>
<BR CLEAR=ALL>
<B>Merck & Co Inc</B>
<BR CLEAR=ALL>
<!-- Begin stock History table -->
--------------------------------
</code>
Is this line -
document.QlistCtl.Symbol.focus();document.QlistCtl.Symbol.select();
telling the page/browser what to do if either the download file butto
or show chart button is pressed? If it is then it appears I'm going t
need to get a grasp of javascript to be able to see what it's doing
Once I know that, is that where the XML stuff comes in? Basicall
trying to send the page/server/whatever info as if it came from th
webpage and the page "responds" accordingly? I glossed over a book a
the store on xml but I didn't see any refernce to working within vb
code but I could have easily missed it.
It's been 6-7 years since I've messed with html(a passing interest).
never bothered to learn vbscript or javascript. I've been using exce
for a few months to run numbers on stocks and basically cut/paste th
info I want but that's getting old. I've written some simple subs an
functions up to this point is all. I just started this project Tuesda
so I've still got alot more learning to do but that's where the fu
is.
Thanks for any input,
Bra