Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Google finance

Hi Group,

I am trying to import in CSV from Google Finance a stock price history. I am
able to do this from Yahoo, but am unable to do it from Google.

The ticker is DD, weekly, from Jan 1, 1990 to Today.

The web address is :
http://finance.google.com/finance/hi...=Jan+28%C+2009

Another problem that I may encounter is that the symbol name is not part of
the above. I is fairly easy to get what is on the screen into code, but I am
unable to get the whole table.

The link to the download is:
http://finance.google.com/finance/hi...9&output=cs v

It is the above I believe has to be coded? Anyone else try and do this? In
Yahoo, this type of address has included the ticker symbol, maybe that what
to "cid=10261" represents? This may make impossible.

Thanks for your imput,
David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Google finance

This is NOT very elegant, but it seems to do the job:
Sub Macro1()

With ActiveSheet.QueryTables.Add(Connection:= _

"URL;http://finance.google.com/finance/historical?histperiod=weekly&cid=10261&startdate=J an+1%2C+1990&+1990&enddate=Jan+28%C+2009&output=cs v" _
, Destination:=Range("A1"))

.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5,
1), Array(6, 1)), _
TrailingMinusNumbers:=True
End Sub

Regards,
Ryan---

--
RyGuy


"David" wrote:

Hi Group,

I am trying to import in CSV from Google Finance a stock price history. I am
able to do this from Yahoo, but am unable to do it from Google.

The ticker is DD, weekly, from Jan 1, 1990 to Today.

The web address is :
http://finance.google.com/finance/hi...=Jan+28%C+2009

Another problem that I may encounter is that the symbol name is not part of
the above. I is fairly easy to get what is on the screen into code, but I am
unable to get the whole table.

The link to the download is:
http://finance.google.com/finance/hi...9&output=cs v

It is the above I believe has to be coded? Anyone else try and do this? In
Yahoo, this type of address has included the ticker symbol, maybe that what
to "cid=10261" represents? This may make impossible.

Thanks for your imput,
David

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Google finance

Hi RYGUY.

I did figure it out finally and was able to use the symbol. The syntax was a
bear. I will work on getting the symbol in as a variable tomorrow.

Thank you for your help. I ended up brain storming it with a friend and
between the two of we got it. If you want the code, just respond again, but I
may not see it till tomorrow.

David

"ryguy7272" wrote:

This is NOT very elegant, but it seems to do the job:
Sub Macro1()

With ActiveSheet.QueryTables.Add(Connection:= _

"URL;http://finance.google.com/finance/historical?histperiod=weekly&cid=10261&startdate=J an+1%2C+1990&+1990&enddate=Jan+28%C+2009&output=cs v" _
, Destination:=Range("A1"))

.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5,
1), Array(6, 1)), _
TrailingMinusNumbers:=True
End Sub

Regards,
Ryan---

--
RyGuy


"David" wrote:

Hi Group,

I am trying to import in CSV from Google Finance a stock price history. I am
able to do this from Yahoo, but am unable to do it from Google.

The ticker is DD, weekly, from Jan 1, 1990 to Today.

The web address is :
http://finance.google.com/finance/hi...=Jan+28%C+2009

Another problem that I may encounter is that the symbol name is not part of
the above. I is fairly easy to get what is on the screen into code, but I am
unable to get the whole table.

The link to the download is:
http://finance.google.com/finance/hi...9&output=cs v

It is the above I believe has to be coded? Anyone else try and do this? In
Yahoo, this type of address has included the ticker symbol, maybe that what
to "cid=10261" represents? This may make impossible.

Thanks for your imput,
David

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Google finance

Sure, please share. In the immortal words of Thomas Jefferson, 'information
is the currency of democracy'.

--
RyGuy


"David" wrote:

Hi RYGUY.

I did figure it out finally and was able to use the symbol. The syntax was a
bear. I will work on getting the symbol in as a variable tomorrow.

Thank you for your help. I ended up brain storming it with a friend and
between the two of we got it. If you want the code, just respond again, but I
may not see it till tomorrow.

David

"ryguy7272" wrote:

This is NOT very elegant, but it seems to do the job:
Sub Macro1()

With ActiveSheet.QueryTables.Add(Connection:= _

"URL;http://finance.google.com/finance/historical?histperiod=weekly&cid=10261&startdate=J an+1%2C+1990&+1990&enddate=Jan+28%C+2009&output=cs v" _
, Destination:=Range("A1"))

.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5,
1), Array(6, 1)), _
TrailingMinusNumbers:=True
End Sub

Regards,
Ryan---

--
RyGuy


"David" wrote:

Hi Group,

I am trying to import in CSV from Google Finance a stock price history. I am
able to do this from Yahoo, but am unable to do it from Google.

The ticker is DD, weekly, from Jan 1, 1990 to Today.

The web address is :
http://finance.google.com/finance/hi...=Jan+28%C+2009

Another problem that I may encounter is that the symbol name is not part of
the above. I is fairly easy to get what is on the screen into code, but I am
unable to get the whole table.

The link to the download is:
http://finance.google.com/finance/hi...9&output=cs v

It is the above I believe has to be coded? Anyone else try and do this? In
Yahoo, this type of address has included the ticker symbol, maybe that what
to "cid=10261" represents? This may make impossible.

Thanks for your imput,
David

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Google finance

Hi,

I just started working on the variable substitute for the symbol, but I am
sure you can handle this. Two lines only inside the With statement.

Sub Macro1()
' Macro1 Macro
With ActiveSheet.QueryTables.Add(Connection:= _

"URL;http://finance.google.com/finance/historical?histperiod=weekly&q=MSFT&startdate=Jan+ 1%2C+1990&enddate=Jan+29%2C+2009&output=csv",
Destination:=Range("A1"))
.Refresh BackgroundQuery:=False
End With
End Sub



"ryguy7272" wrote:

Sure, please share. In the immortal words of Thomas Jefferson, 'information
is the currency of democracy'.

--
RyGuy


"David" wrote:

Hi RYGUY.

I did figure it out finally and was able to use the symbol. The syntax was a
bear. I will work on getting the symbol in as a variable tomorrow.

Thank you for your help. I ended up brain storming it with a friend and
between the two of we got it. If you want the code, just respond again, but I
may not see it till tomorrow.

David

"ryguy7272" wrote:

This is NOT very elegant, but it seems to do the job:
Sub Macro1()

With ActiveSheet.QueryTables.Add(Connection:= _

"URL;http://finance.google.com/finance/historical?histperiod=weekly&cid=10261&startdate=J an+1%2C+1990&+1990&enddate=Jan+28%C+2009&output=cs v" _
, Destination:=Range("A1"))

.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5,
1), Array(6, 1)), _
TrailingMinusNumbers:=True
End Sub

Regards,
Ryan---

--
RyGuy


"David" wrote:

Hi Group,

I am trying to import in CSV from Google Finance a stock price history. I am
able to do this from Yahoo, but am unable to do it from Google.

The ticker is DD, weekly, from Jan 1, 1990 to Today.

The web address is :
http://finance.google.com/finance/hi...=Jan+28%C+2009

Another problem that I may encounter is that the symbol name is not part of
the above. I is fairly easy to get what is on the screen into code, but I am
unable to get the whole table.

The link to the download is:
http://finance.google.com/finance/hi...9&output=cs v

It is the above I believe has to be coded? Anyone else try and do this? In
Yahoo, this type of address has included the ticker symbol, maybe that what
to "cid=10261" represents? This may make impossible.

Thanks for your imput,
David



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Google finance

Ummm, ok, but I think you need to split that out, right. Use Data Text to
Columns to get normalized results.

Regards,
Ryan---
--
RyGuy


"David" wrote:

Hi,

I just started working on the variable substitute for the symbol, but I am
sure you can handle this. Two lines only inside the With statement.

Sub Macro1()
' Macro1 Macro
With ActiveSheet.QueryTables.Add(Connection:= _

"URL;http://finance.google.com/finance/historical?histperiod=weekly&q=MSFT&startdate=Jan+ 1%2C+1990&enddate=Jan+29%2C+2009&output=csv",
Destination:=Range("A1"))
.Refresh BackgroundQuery:=False
End With
End Sub



"ryguy7272" wrote:

Sure, please share. In the immortal words of Thomas Jefferson, 'information
is the currency of democracy'.

--
RyGuy


"David" wrote:

Hi RYGUY.

I did figure it out finally and was able to use the symbol. The syntax was a
bear. I will work on getting the symbol in as a variable tomorrow.

Thank you for your help. I ended up brain storming it with a friend and
between the two of we got it. If you want the code, just respond again, but I
may not see it till tomorrow.

David

"ryguy7272" wrote:

This is NOT very elegant, but it seems to do the job:
Sub Macro1()

With ActiveSheet.QueryTables.Add(Connection:= _

"URL;http://finance.google.com/finance/historical?histperiod=weekly&cid=10261&startdate=J an+1%2C+1990&+1990&enddate=Jan+28%C+2009&output=cs v" _
, Destination:=Range("A1"))

.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5,
1), Array(6, 1)), _
TrailingMinusNumbers:=True
End Sub

Regards,
Ryan---

--
RyGuy


"David" wrote:

Hi Group,

I am trying to import in CSV from Google Finance a stock price history. I am
able to do this from Yahoo, but am unable to do it from Google.

The ticker is DD, weekly, from Jan 1, 1990 to Today.

The web address is :
http://finance.google.com/finance/hi...=Jan+28%C+2009

Another problem that I may encounter is that the symbol name is not part of
the above. I is fairly easy to get what is on the screen into code, but I am
unable to get the whole table.

The link to the download is:
http://finance.google.com/finance/hi...9&output=cs v

It is the above I believe has to be coded? Anyone else try and do this? In
Yahoo, this type of address has included the ticker symbol, maybe that what
to "cid=10261" represents? This may make impossible.

Thanks for your imput,
David

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Google finance

On Jan 28, 9:17*pm, ryguy7272
wrote:
This is NOT very elegant, but it seems to do the job:
Sub Macro1()

* * With ActiveSheet.QueryTables.Add(Connection:= _

"URL;http://finance.google.com/finance/historical?histperiod=weekly&cid=10..." _
* * * * , Destination:=Range("A1"))

* * * * .FieldNames = True
* * * * .RowNumbers = False
* * * * .FillAdjacentFormulas = False
* * * * .PreserveFormatting = True
* * * * .RefreshOnFileOpen = False
* * * * .BackgroundQuery = True
* * * * .RefreshStyle = xlInsertDeleteCells
* * * * .SavePassword = False
* * * * .SaveData = True
* * * * .AdjustColumnWidth = True
* * * * .RefreshPeriod = 0
* * * * .WebSelectionType = xlSpecifiedTables
* * * * .WebFormatting = xlWebFormattingNone
* * * * .WebTables = "2"
* * * * .WebPreFormattedTextToColumns = True
* * * * .WebConsecutiveDelimitersAsOne = True
* * * * .WebSingleBlockTextImport = False
* * * * .WebDisableDateRecognition = False
* * * * .WebDisableRedirections = False
* * * * .Refresh BackgroundQuery:=False
* * End With

* * Columns("A:A").Select
* * Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
* * * * TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
* * * * Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
* * * * :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5,
1), Array(6, 1)), _
* * * * TrailingMinusNumbers:=True
End Sub

Regards,
Ryan---

--
RyGuy



"David" wrote:
Hi Group,


I am trying to import in CSV from GoogleFinancea stock price history. I am
able to do this from Yahoo, but am unable to do it from Google.


The ticker is DD, weekly, from Jan 1, 1990 to Today.


The web address is :
http://finance.google.com/finance/hi...=weekly&cid=10...


Another problem that I may encounter is that the symbol name is not part of
the above. I is fairly easy to get what is on the screen into code, but I am
unable to get the whole table.


The link to the download is:
http://finance.google.com/finance/hi...=weekly&cid=10...


It is the above I believe has to be coded? Anyone else try and do this? In
Yahoo, this type of address has included the ticker symbol, maybe that what
to "cid=10261" represents? This may make impossible.


Thanks for your imput,
David- Hide quoted text -


- Show quoted text -


If you wanna save money visit www.meilleurtauxhypothecaire.com
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Google finance

On Jan 28, 8:37*pm, David wrote:
Hi Group,

I am trying to import in CSV from GoogleFinancea stock price history. I am
able to do this from Yahoo, but am unable to do it from Google.

The ticker is DD, weekly, from Jan 1, 1990 to Today.

The web address is :http://finance.google.com/finance/hi...=weekly&cid=10...

Another problem that I may encounter is that the symbol name is not part of
the above. I is fairly easy to get what is on the screen into code, but I am
unable to get the whole table.

The link to the download is:http://finance.google.com/finance/hi...=weekly&cid=10...

It is the above I believe has to be coded? Anyone else try and do this? In
Yahoo, this type of address has included the ticker symbol, maybe that what
to "cid=10261" represents? This may make impossible.

Thanks for your imput,
David


If you wanna save money visit www.meilleurtauxhypothecaire.com
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
chart in excel like google finance chart Laoballer Charts and Charting in Excel 3 October 26th 09 05:46 PM
finance functions not available Ivanl Excel Worksheet Functions 8 July 24th 07 08:06 PM
finance functions Star Excel Programming 0 December 15th 05 07:47 AM
finance workbook Randy Excel Discussion (Misc queries) 0 November 29th 04 11:05 PM
vba yahoo! finance Arun Ram Kumaran Excel Programming 1 July 25th 03 01:04 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"