LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default import from web


michelxld Wrote:
Hello Sal21

I hope this help you


Sub Importer_tableauPageWeb_V02()
'MichelXld le 09.06.2005
'
'activate Microsoft HTML Objects Library
'activate Microsoft Internet Controls
'
Dim IE As InternetExplorer
Dim maPageHtml As HTMLDocument
Dim Htable As IHTMLElementCollection
Dim maTable As IHTMLTable
Dim j As Integer, i As Integer, x As Integer, Ligne As Integer
Dim NbPages As Byte, y As Byte


Application.ScreenUpdating = False

For NbPages = 65 To 90

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = False
IE.navigate "http://www.capitalmarket.com/bulletin/bsebhav.asp?var=" &
Chr(NbPages)
Do Until IE.readyState = READYSTATE_COMPLETE
DoEvents
Loop

Set maPageHtml = IE.document
Set Htable = maPageHtml.getElementsByTagName("table") 'objet type
table

For x = 2 To Htable.Length - 1

If x = 2 And NbPages = 65 Then
y = 1
Else
y = 4
End If

Set maTable = Htable(x)

For i = y To maTable.Rows.Length 'rows in table
Ligne = Ligne + 1

For j = 1 To maTable.Rows(i - 1).Cells.Length 'each cell in row
Cells(Ligne, j) = maTable.Rows(i - 1).Cells(j - 1).innerText
Next j

Next i
Next x

DoEvents
IE.Quit
Set IE = Nothing
Next NbPages

Application.ScreenUpdating = True
End Sub



Regards ,
michel


Hi michelxld, tks many tks the code work fine....
Sal.


--
sal21


------------------------------------------------------------------------
sal21's Profile: http://www.excelforum.com/member.php...fo&userid=2040
View this thread: http://www.excelforum.com/showthread...hreadid=377874

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
import txt with VB peterhall New Users to Excel 0 August 11th 10 03:03 AM
import XML data...Is there a size limit on the import? MatthewG Excel Discussion (Misc queries) 0 February 10th 09 05:57 PM
How to Start Excel in Text Import Wizard for data import rlelvis Setting up and Configuration of Excel 0 July 10th 08 08:40 PM
XML Import Roberto Excel Worksheet Functions 0 February 8th 08 08:10 AM
I can import Access Tables. But, I can't import Access queries nickg420[_8_] Excel Programming 0 August 5th 04 07:46 PM


All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"