ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MS Excel Web Query (https://www.excelbanter.com/excel-programming/372481-ms-excel-web-query.html)

gildum

MS Excel Web Query
 
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



NickHK[_3_]

MS Excel Web Query
 
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

"gildum" bl...
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




gildum

MS Excel Web Query
 
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
--
gildum

Antispam: replace 5 with 2



"NickHK" ha scritto nel messaggio
...
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




NickHK

MS Excel Web Query
 
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

"gildum" wrote in message
...
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
--
gildum

Antispam: replace 5 with 2



"NickHK" ha scritto nel messaggio
...
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







All times are GMT +1. The time now is 08:00 AM.

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