View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams Tim Williams is offline
external usenet poster
 
Posts: 1,588
Default Use VBA to copy a chart from the internet?

http://groups-beta.google.com/group/...a49fffd094fe65

Tim


"quartz" wrote in message
...
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