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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Mudface

MrExcel MVP
Joined
Feb 18, 2002
Messages
3,339
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>
 

yosi

Board Regular
Joined
May 14, 2002
Messages
67
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 ?
 

NatxUK

New Member
Joined
May 20, 2002
Messages
11
Looking at that code i dont think it would be suported on 2000 or below. XP has a bit more functionality

Cheers

Nattie
 

Mudface

MrExcel MVP
Joined
Feb 18, 2002
Messages
3,339
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>
 

Sbirro Cornuto

Board Regular
Joined
Mar 18, 2002
Messages
93
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?
 

Forum statistics

Threads
1,147,823
Messages
5,743,409
Members
423,792
Latest member
travisds

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
Top