PlanetSquires Forums

Support Forums => General Board => Topic started by: Cho Sing Kum on April 09, 2014, 07:32:17 AM

Title: XLS to CSV
Post by: Cho Sing Kum on April 09, 2014, 07:32:17 AM

Hi Paul,

I am looking at an old article of yours in PSC:
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=11898&lngWId=1

I am looking for some VB6 example to go the other way - XLS to CSV. I want to avoid ADO (and any OCX/ActiveX). Additionally, I have to assume there is no Excel installed on target computers so create Excel objects is out of the question.

If I were to "reverse engineer" your codes, will I be able to do it? I am thinking the core would be in the WriteValue function of ExcelFile.cls.

The XLS source is from the following link and no matter how I try to fake it by changing the contentType in the URL, the file is still XLS.

http://quotes.wsj.com/cdssvco/marketwatch/dylan/v1/HistoricalPrices?ticker=DJIA&countrycode=US&startDate=01-08-2014&endDate=04-08-2014&duration=P1D&pagePos=0&pageSize=0&sortColumn=Time&sortOrder=DESC&contentType=xls

Title: Re: XLS to CSV
Post by: Knuth Konrad on April 09, 2014, 08:23:32 AM
Is the Wallstreet Journal as a data source a must? If not, how about i.e. Yahoo stock market quotes readily deliverd as CSV (http://finance.yahoo.com/q/hp?a=&b=&c=&d=3&e=9&f=2014&g=d&s=%5EDJI%2C+&ql=1) (scroll a bit down for the download link).

See also http://blog.programmableweb.com/2013/05/22/96-stocks-apis-bloomberg-nasdaq-and-etrade/ (http://blog.programmableweb.com/2013/05/22/96-stocks-apis-bloomberg-nasdaq-and-etrade/) for other stock market APIs.
Title: Re: XLS to CSV
Post by: Cho Sing Kum on April 09, 2014, 08:45:39 AM

I have been using Yahoo for many years but they stopped downloading of DJ family of indexes about 1-1/2 to 2 years ago. They still do allow for other indexes but not DJ's.

MSN Money and Google Finance do not allow download of all stock indexes.

I just happen to stumble onto WSJ after looking around for quite some time.
Title: Re: XLS to CSV
Post by: Eddy Van Esch on April 09, 2014, 09:23:29 AM
Cho,
The below link works for me to download csv historical data for DJIA from Yahoo Finance.
Don't know about other indexes you might need though ...
http://ichart.yahoo.com/table.csv?s=DJIA&a=02&b=01&c=2010&d=03&e=08&f=2014&g=d&ignore=.csv

Kind regards
Title: Re: XLS to CSV
Post by: Cho Sing Kum on April 09, 2014, 10:54:49 AM
You are the man!

Using your link, I notice that it use a slightly different symbol. I just trial and error and found the replacement for the other DJ symbols:

DJIA (instead of ^DJI)
DJUA (instead of ^DJU)
DJTA (instead of ^DJT)
DJCA (instead of ^DJC)

Thanks very much.
Title: Re: XLS to CSV
Post by: Cho Sing Kum on June 28, 2014, 05:08:55 AM

DJUA, DJTA and DJCA have stopped working the past few days. XLS to CSV via wsj.com still the most reliable. I find a way to reverse engineer.

Title: Re: XLS to CSV
Post by: Cho Sing Kum on June 29, 2014, 09:27:04 AM

Changing my search to VB6 Read BIFF (instead of VB6 Read XLS) give me the search result I am looking for. Found something here at PSC:

http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=61368&lngWId=1

The included XLS converted okay. Will delve into it.