OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Retrieve cell value from web page?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
Mina
Guest





PostPosted: Thu Nov 20, 2003 9:09 am    Post subject: Retrieve cell value from web page? Reply with quote

I'd like to retrieve a value from a web page and use it for calculations. Basically, I'd like to get the current share price of a mutual fund, place that value in the spreadsheet, and use it for calculations.

Is there a way to do this? I've searched a while and don't see much about this. Could this be done with a macro of a sort?

thanks,
Mina
Back to top
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Thu Nov 20, 2003 9:18 am    Post subject: Reply with quote

Copy & paste of a single value worked for me.
Back to top
View user's profile Send private message
Bryan
Guest





PostPosted: Thu Nov 20, 2003 9:36 am    Post subject: Reply with quote

Errr, I'll rephrase that..

I'd like to have the spreadsheet retrieve the value from the web page automatically. With a list of five mutual funds, I'd like the spreadsheet to retrieve the current NAV (share price) of the fund from a web page.

Using [Insert -> External data], I can get a block of text from the web page. How can I filter that text down to just the number value I want?

thanks,
Mina
Back to top
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Thu Nov 20, 2003 10:03 am    Post subject: Reply with quote

Download the SDK. There is an example in there that does what you are asking.

It is a Calc spreadsheet called "stock".

On Sheet 2, you list the stock symbols you are interested in.

On Sheet 1, you click a button, and the macro goes out to the web, gets the results for right now for all of the symbols, and adds them to rows of the spreadsheet in Sheet 1. It also updates a graph showing the performance of all of the stocks.

If you open the spreadsheet each day and click the button, then over time, you end up with a graph and a table of the prices of the stock at each time you ran the macro. Even if you run the macro at irregular intervals, the "time" axes of the graph is correct, it is just that the data points are irregularly spaced over time.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Guest






PostPosted: Thu Nov 20, 2003 10:14 am    Post subject: Reply with quote

Thanks!
Back to top
Guest






PostPosted: Thu Nov 20, 2003 1:06 pm    Post subject: Reply with quote

Okay, perhaps this is more complex than I expected. When I load the stock spreadsheet and click on the update button, I get a basic runtime error telling me that com.sun.star.container.noSuchElementException.

Also odd, I can't save that example under a different name or edit it. Is there an installation of the SDK I need to follow?
Back to top
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Thu Nov 20, 2003 9:47 pm    Post subject: Reply with quote

When I used the stock spreadsheet, I was using it under OOo 1.0.x. I wonder if it has problems under 1.1?

Or maybe it should be used on 1.1 and you are using 1.0?

Maybe I should send you the version I was using from an earlier version of the SDK?
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Bryan
General User
General User


Joined: 20 Nov 2003
Posts: 5

PostPosted: Fri Nov 21, 2003 7:03 am    Post subject: Reply with quote

It might be a proxy problem. I tried it at work and it failed as described above. At home it worked perfectly. There's so much code there, and I'm not familiar with that language at all. With time I'll figure it out, but if anyone has just a simple macro to get the current price of a stock and place it in a cell, I'd really appreciate it.
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Mon Jan 19, 2004 10:01 am    Post subject: Reply with quote

Bryan wrote:
With time I'll figure it out, but if anyone has just a simple macro to get the current price of a stock and place it in a cell, I'd really appreciate it.


See this....

http://www.oooforum.org/forum/viewtopic.php?t=4103
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group