MS Excel Web Query

G

gildum

Windows XP, Excel 2000
Every day I use the following macro in order to import the day's quotes from
Yahoo.
Now I would have need to import some day's quotes from www.swissquote.ch
rather than from Yahoo.
I have tried to modify the macro but they are not successful to obtain the
intentional result.
You can help me?
Thanks a lot!
--
gildum

Antispam: replace 5 with 2




Sub test()

With ActiveSheet.QueryTables.Add(Connection:="URL;" & _
"http://it.finance.yahoo.com/d/quotes.csv?s=MSFT+IBM&f=sl1d1+1c1ohgv&e=.csv",
_
Destination:=ActiveSheet.Cells(1, 1))

.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub
 
N

NickHK

You have not posted the code that you are now trying to use, so I can't say
much, but that site looks like it requires a login.
Maybe you can send the login details in the URL or The .PostText property of
the QT.
Also a bit more information would help: errors , results recieved/expected
etc

NickHK
 
G

gildum

Hi Nick,
The code that I am testing is:

Sub test2()

With ActiveSheet.QueryTables.Add(Connection:="URL;" & _
"http://www.swissquote.ch/cgi-bin/SQ_portfolio/pf_account.csv", _
Destination:=ActiveSheet.Cells(1, 1))

.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub

Whit this code I get the following error:

*Identificatin Error*
*Sorry, the program was not able to check your identification. The Cookie
may be expired. Please login again.*

To access manually the Portfolio Page the login require an UserID end the
Password. In the code I do not know how send them!

Thanks
 
N

NickHK

Looks like the site sets a cookie when you login.
Unless you find some way to fake the cookie (which is not an Excel concern)
you are stuck with having to login.

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top