Ask Your Question
0

basic loadComponentFromURL

asked 2016-01-27 21:26:07 +0200

BobW gravatar image

updated 2016-03-10 11:38:56 +0200

Alex Kemp gravatar image

My version of LibreOffice is 4.4.7.2
My operating system is OSX 10.11.3
I have written a Basic macro in a Calc spreadsheet to retrieve mutual fund history from yahoo finance.
This is the macro.

[code]
Sub Main
   get_history "VWIAX"
End Sub
Sub get_history(ticker as String)
   Dim Url as String
   Dim oDoc as Object
   Dim oArg(0) As New com.sun.star.beans.PropertyValue
   Url = "http://ichart.finance.yahoo.com/table..." & ticker & "&g=m&ignore=.csv"
   Print Url
   oArg(0).Name = "FilterOptions"
   oArg(0).Value = "44"
   oDoc = starDeskTop.loadComponentFromURL(Url, "_blank", 0, oArg)
End Sub
[/code]

The last step "starDeskTop.loadComponentFromURL(..." hangs on some ticker symbols but not others.
Some tickers which hang are VGSLX, FCNTX and VWIAX.
Some tickers which do not hang are FGMNX, FPURX

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-02-01 08:10:49 +0200

JohnSUN gravatar image

IMHO, that such a request is more correct

Url = "http://ichart.finance.yahoo.com/table.csv?s=" + ticker + "&c=2001&f=2016&g=m&ignore=.csv"

(If you want "months" g=m, then you need to specify the start and end year)

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-01-27 21:26:07 +0200

Seen: 1,313 times

Last updated: Feb 01 '16