sorgulamayı yapıyor ama excel sayfasına yazdıramadım

Katılım
7 Eylül 2008
Mesajlar
76
Excel Vers. ve Dili
yok
ekde dosyayı koydum
düzeltebilecek biri olursa sevinirim
 
Son düzenleme:

Kemal Demir

Özel Üye
Katılım
29 Temmuz 2004
Mesajlar
2,108
Kod:
Private Sub CommandButton1_Click()
On Error Resume Next
Dim IE As Object
Dim HTML_Body As Object, HTML_Tables As Object, MyTable As Object
Dim RetVal As Variant
If TextBox1.Value = "" Or TextBox2.Value = "" Or TextBox3.Value = "" Or TextBox4.Value = "" Then
MsgBox ("Boş alan Bıraktınız")
Exit Sub
End If
ilk = TextBox3
son = TextBox4
For z = ilk To son
DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents:
DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents:
DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents:
DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents:
ADI = TextBox1
SADI = TextBox2
DoEvents
Label5 = "D.Yılı" & " " & ":" & z
alan = "http://www.emekli.gov.tr/bilgi/SicilTespitiServlet2?ad2=" & ADI & " &soyad=" & SADI & "&dogumYil=" & z & "&mevzuatgoruntuleButon=TAMAM"
URL = alan
DoEvents
WebBrowser1.Navigate2 (alan) 'CreateObject("InternetExplorer.Application")
  With WebBrowser1
        .Navigate URL
        .Visible = True
     Do Until WebBrowser1.ReadyState = 4: DoEvents: Loop
        With .Document.all
        End With
        Set HTML_Body = WebBrowser1.Document.getElementsByTagName("Body").Item(0)
        Set HTML_Tables = HTML_Body.getElementsByTagName("Table")
           Set MyTable = HTML_Tables(2)
    For x = 0 To 20
    son = [a65536].End(3).Row + 1
    Cells(son, 1) = MyTable.Rows(x).Cells(0).innerText
    Cells(son, 2) = MyTable.Rows(x).Cells(1).innerText
    Cells(son, 3) = MyTable.Rows(x).Cells(2).innerText
    Cells(son, 4) = MyTable.Rows(x).Cells(3).innerText
    Cells(son, 5) = MyTable.Rows(x).Cells(4).innerText
    Cells(son, 6) = MyTable.Rows(x).Cells(5).innerText
    Cells(son, 7) = MyTable.Rows(x).Cells(6).innerText
    Cells(son, 8) = MyTable.Rows(x).Cells(7).innerText
  '  Cells(son, 9) = MyTable.Rows(x).Cells(8).innerText
    Cells(son, 10) = "'" & y & "-" & x
 Next
DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents:
DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents:
DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents:
DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents: DoEvents:
   End With
Next
   Set HTML_Body = Nothing
    Set HTML_Tables = Nothing
    Set MyTable = Nothing
    Set IE = Nothing
End Sub
Yukarıdaki gibi değiştiriniz.
 
Katılım
7 Eylül 2008
Mesajlar
76
Excel Vers. ve Dili
yok
teşekkür ederim eline sağlık
 
Üst