LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default .csv problem?

hallo,
i found the following macro on the web, that helps me get stock prices
from yahoo into a spreadsheet, but i have a problem with the
seperation of the cells.

Sub GetYQuotes()
Base01 = "http://de.finance.yahoo.com/d/quotes.csv?s=" '("http://
finance.yahoo.com/d/quotes.csv?s=")

Base02 = "&f=sl1d1t1c1ohgv&e=.csv"
surl = ""
SymString = ""
LastRow = Cells(65536, 1).End(xlUp).Row
For i = 1 To LastRow
SymString = SymString & Cells(i, 1) & " "
Next i
surl = Base01 & SymString & Base02
Workbooks.Open surl
Set rngSource = Cells(1).CurrentRegion
x = rngSource.Rows.Count
y = rngSource.Columns.Count
With ThisWorkbook.Sheets(1)
Set rngDest = Range(.Cells(1, 1), .Cells(x, y))
End With
rngDest.Value = rngSource.Value
ActiveWorkbook.Close SaveChanges:=False
End Sub


the problem is, that if i run it with german yahoo finance site, the
information about the stock will be seperated wrongly ("DCX.DE;48"
"52;2/2/2007;17:35;+0" "28;48" "02;48" "64;47" "87;5770938") The
correct separation would be ("DCX.DE" "48,52" "2/2/2007" "17:35"
"+0,28" "48,02"; "48,64" "47,87" "5770938).
Seems to be a problem with vba (perhaps a problem between english and
german excel 2003 version with comma and semicolon). If i introduce
the web address in the browser, excel opens a file with correct
seperations. ("http://de.finance.yahoo.com/d/quotes.csv?s=DCX.DE
&f=sl1d1t1c1ohgv&e=.csv")

I tried to modify the workbooks.open method (format and delimiter) but
it didn't work.

Any idea?
Thank you very much
Lars

 
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
Colon at the end of excel file name(ex: problem.xls:1, problem.xls financeguy New Users to Excel 2 January 15th 10 01:15 AM
Started out as an Access problem. Now an Excel problem RobertM Excel Discussion (Misc queries) 2 April 26th 06 07:30 PM
problem with a conditional max problem Brian Cornejo Excel Discussion (Misc queries) 1 February 18th 05 06:25 PM
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? OCI Excel Programming 0 May 16th 04 10:40 PM


All times are GMT +1. The time now is 09:04 AM.

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"