Web query

S

Svilen

I am importing a web page content into excel sheet.
The page is this:
http://www.bnb.bg/FinancialMarkets/FMSofibidAndSofibor/index.htm
With web query I could import the table on this page but I need the title as
well which is not placed in the table. Is there a guide how to do this (and
how to import in excel sheet a particular element of the web page, in
general)?

On this page there is a download button for xls, csv and xml but as they are
dynamically generated I couldn't find a way to link them to my file. If you
press download you will be asked to save the xls file but the link to it is
without the name:
http://www.bnb.bg/FinancialMarkets/FMSofibidAndSofibor/index.htm?download=MS-Excel&search=
Is it possible to make links or web queries to such files?
 
J

joel

The title is not part of the table and you can't extract it using
Webquery. this code will get the title using an IE application. I
only returns the Title and yoiu will still new the query to get the res
of the data. I can modify the code to extract the entire table.


Function GetTitle()


URL = "http://www.bnb.bg/FinancialMarkets/FMSofibidAndSofibor" & _
"/index.htm"

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True


'get web page
IE.Navigate2 URL
Do While IE.readystate <> 4 Or _
IE.busy = True

DoEvents
Loop

Set Title = IE.document.getelementbyid("Sofibid_sofibor_search")
GetTitle = Title.innertext

IE.Quit

End Functio
 
J

joel

You could do use it as a UDF by inserting a dummy variable in th
parameter list


Function GetTitle(Dummy)


the call it like this

=GetTitle(B1)


by putting a cell in the parameter list the code will be called ever
time the location B1 gets changed. UDF functions only get called whe
the range in the parameter list gets called. So if you r query put
updates Cell B1 then the new title gets called
 

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