ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Use VBA to copy a chart from the internet? (https://www.excelbanter.com/excel-programming/318392-use-vba-copy-chart-internet.html)

quartz[_2_]

Use VBA to copy a chart from the internet?
 
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


Tim Williams

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





All times are GMT +1. The time now is 10:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com