How to fetch information from the web?

Sbirro Cornuto

Board Regular
Joined
Mar 18, 2002
Messages
93
I know how to open the web site. I do it with code like this:

*********************************************
Application.DisplayAlerts = False

ActiveWorkbook.FollowHyperlink Address:= _
"http://www.bof.fi/ohi/fin/0_new/0.1_valuuttak/fix-fin-bw.htm", NewWindow:= _
True, AddHistory:=False
Application.WindowState = xlMaximized
*********************************************

How could I read the data from that web site programmatically?

Now I have the user searching the correct line manually and copying and pasting it to the use of my program.

I´m assuming this could all be done automaticly since the data is in the kind of a form that it is. (Check it out)

http://www.bof.fi/ohi/fin/0_new/0.1_valuuttak/fix-fin-bw.htm

I just don´t know where to start, do YOU?

Thx in advanz

Sbirro
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
I just recorded a macro of myself performing a Web Query (Data- Import External Data- New Web Query) and importing the data to the activesheet. This was done with Excel 2002 and gave the following code, which may be of help. Not sure if Excel 97 or 2000 offers the same functionality, though: -
<pre>
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 24/10/2002 by CHowarth
'

'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.bof.fi/eng/0_new/0.1_valuuttak/fix-eng.stm", Destination:= _
Range("A1"))
.Name = "fix-eng"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "3"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
</pre>
 
Upvote 0
excel has the ability to save a Query and refresh data, its diffrent between Excel versions - 97, 2000 or 2002

what Excel version you use ?
 
Upvote 0
Looking at that code i dont think it would be suported on 2000 or below. XP has a bit more functionality

Cheers

Nattie
 
Upvote 0
Same thing with Excel 2000, Excel '97 doesn't seem to support this in the same way: -
<pre>
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 24/10/2002 by Chris Norma
'

'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.bof.fi/ohi/fin/0_new/0.1_valuuttak/fix-fin-bw.htm", _
Destination:=Range("A1"))
.Name = "fix-fin-bw"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
End With
End Sub
</pre>
 
Upvote 0
Thanks for the effort guys, unfortunately running 97 on NT, so them nice solutions of yours don´t work for me straight away. Gave some ideas though, thanks. Wouldn´t happen to know solution suitable for 97?
 
Upvote 0

Forum statistics

Threads
1,213,550
Messages
6,114,265
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top