Use VBA to copy a chart from the internet?

Q

quartz

I am working on a program that pulls stock information from the internet
directly into Excel. I am using a query table to get stock quotes, which
works great, but I would also like to pull in the default historical chart
that also appears on the web site.

Is this possible? The chart is a 'gif' image and I can right click it and
manually copy it, but I want to be able to do this in one step automatically.
Does anyone know how to do this?

Thanks in advance for your assistance. My code so far follows:

Dim qts As QueryTables
Dim qt As QueryTable

Set qts = ActiveSheet.QueryTables
Set qt = qts.Add(mstrConnection & mstrStockSymbol, Range(ActiveCell.Address))
With qt
.AdjustColumnWidth = True
.BackgroundQuery = False
If .FetchedRowOverflow Then MsgBox "Query too large!"
.FieldNames = True
.PreserveColumnInfo = False
.PreserveFormatting = True
.WebConsecutiveDelimitersAsOne = True
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.WebFormatting = xlWebFormattingNonel
.WebPreFormattedTextToColumns = False
.WebSingleBlockTextImport = False
.WebSelectionType = xlSpecifiedTables
.WebTables = mstrWebTables
.Refresh
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top