Pregunta

I have to build and app that extracts stock exchange data from an excel sheet then save it in a database. The problem is that the excel sheet obtains new data via a Bloomberg plug in.

To refresh the page, the user has to open the spread sheet and hit the refresh button on the plug in in excel. After a second the data is added to the sheet.

i have seen guides about getting or putting data to an excel sheet via java but am not sure how to open the sheet, trigger the update and get the data.

¿Fue útil?

Solución

Maybe you can retrieve the data directly with Excel, by using Web Queries. So basically, this feature allows you to get data from the web. You specify the URL, then you select which data on the page you want to import.

You can write these queries in VB as well (ask if you want more details on how to do it with VB).

http://office.microsoft.com/

Otros consejos

It is not clear what you are trying to achieve. I understand that you only use the spreadsheet to get the data and save it to a database.

There are a few alternatives I can think of:

  • [dirty] create a scheduled task in Windows that opens the spreadsheet every x minutes / hours. In your workbook, create a Workbook_Open event that uses Application.OnTime to execute a macro to do what you need to do with the data after a few minutes (the time it takes for the data to update). This is error-prone and will probably fail from time to time.
  • [better] use something similar except that you get the data programmatically with the VBA Addin, populate the sheet from VBA and/or do what you need to do with the data. No need for Application.OnTime in that case. You can even automatically save/close the spreadsheet.
  • [better] Have your java code get the data and send it to your database. If users need the data in Excel, you can have Excel query the database when required.

Note: with a typical Bloomberg Terminal/Anywhere license, it is not permitted to save data on a different machine so the database would need to be located on the local PC. Other licenses have different terms.

I think you should look into using Bloomberg's API v3 to retrieve the data. You have access to any field which you see in FLDS on the Bloomberg terminal.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top