Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
import txt with VB | New Users to Excel | |||
import XML data...Is there a size limit on the import? | Excel Discussion (Misc queries) | |||
How to Start Excel in Text Import Wizard for data import | Setting up and Configuration of Excel | |||
XML Import | Excel Worksheet Functions | |||
I can import Access Tables. But, I can't import Access queries | Excel Programming |