İnternet Sayfasındaki TextBox Adı

Katılım
22 Ekim 2011
Mesajlar
261
Excel Vers. ve Dili
2013
Lablerin adlarını koda yerleştirdim. Ancak renkli satırda hata verdi.
Nasıl düzeltilir.

' İŞE GİRİŞ VE İŞTEN ÇIKIŞ TOPLU BİLDİRGESİ
Sub GirisCikisBildirgesiTOPLU()

With CreateObject("internetexplorer.application")
.Visible = True
.navigate "https://uyg.sgk.gov.tr/SgkTescil4a/"

Do Until .ReadyState = 4: DoEvents: Loop
Do While .Busy: DoEvents: Loop

.document.all.j_id2030916047_790d5140.Value = 12345678912# 'Kullanıcı Adı
.document.all.j_id2030916047_790d5166.Value = 5 'Kontrol No
.document.all.j_id2030916047_790d511f.Value = 11111111 'Sistem Şifresi
.document.all.j_id2030916047_790d5125.Value = 22222222 'İşyeri Şifresi
End With

End Sub
 

Ekli dosyalar

halit3

Uzman
Uzman
Katılım
18 Ocak 2008
Mesajlar
12,758
Excel Vers. ve Dili
2003 excell türkçe
ve
2007 excell türkçe
Güvenlik anaktarı var bu uygulamalarla uğraşmak boşa zaman emek harcamak demek.
Yarın bir gün nesnelerin adı değişebilir veya web sitesinin formatı değişebilir.

kod:

Kod:
' İŞE GİRİŞ VE İŞTEN ÇIKIŞ TOPLU BİLDİRGESİ
Sub GirisCikisBildirgesiTOPLU()
Dim URL As String

Dim ie As Object
URL = "https://uyg.sgk.gov.tr/SgkTescil4a/"
Set ie = CreateObject("InternetExplorer.Application")
With ie
.navigate URL
.Visible = 1
Do Until ie.ReadyState = 4: DoEvents: Loop
Do While ie.busy: DoEvents: Loop
ie.document.all("loginForm:j_id2030916047_790d5153").Value = 12345678912# 'Kullanıcı Adı
ie.document.all("loginForm:j_id2030916047_790d5166").Value = 5 'Kontrol No
ie.document.all("loginForm:j_id2030916047_790d5112").Value = 11111111 'Sistem Şifresi
ie.document.all("loginForm:j_id2030916047_790d5138").Value = 22222222 'İşyeri Şifresi
'ie.Quit: Set ie = Nothing
End With
MsgBox ("Bitti  ")
End Sub
 
Katılım
22 Ekim 2011
Mesajlar
261
Excel Vers. ve Dili
2013
Halit bey;
Yine benzer konuda engin bilgilerinize ihtiyacım var.
Aşağıdaki do ile 4 Texbox'a kadar veri alıyor. 4 den fazla texbox'a veri aldırmak için nasıl bir düzenleme yapmak icab ediyor.
Kod:
' EMEKLİ MAAŞ HESAPLA
Sub SGKemekliMAAS()

With CreateObject("internetexplorer.application")
  .Visible = True
  .navigate "https://uyg.sgk.gov.tr/AylikHesap/"

   Do Until .ReadyState = 4: DoEvents: Loop
   Do While .Busy: DoEvents: Loop

   .document.all.mernisno.Value = 12345678912#
   .document.all.sicilno.Value = 12345678
   .document.all.babaadi.Value = 85568329
   .document.all.ilkodu.Value = 6
   .document.all.doggun.Value = 30
   .document.all.doggun.Value = 12
   .document.all.doggun.Value = 1976
End With

End Sub
 

halit3

Uzman
Uzman
Katılım
18 Ocak 2008
Mesajlar
12,758
Excel Vers. ve Dili
2003 excell türkçe
ve
2007 excell türkçe
30.05.1960 Ankara doğumlu için

Kırmızı yerlerdeki sayılar açılan listedeki sıra numarasındaki değerleri ifade ediyor.

kod:


Kod:
Sub GirisCikisBildirgesiTOPLU()
Dim URL As String

Dim ie As Object
URL = "https://uyg.sgk.gov.tr/AylikHesap/"
Set ie = CreateObject("InternetExplorer.Application")
With ie
.navigate URL
.Visible = 1
Do Until ie.ReadyState = 4: DoEvents: Loop
Do While ie.busy: DoEvents: Loop
ie.document.all("mernisno").Value = 12345678912#
ie.document.all("sicilno").Value = 12345678
ie.document.all("babaadi").Value = 85568329
ie.document.all("ilkodu").selectedIndex = [COLOR="Red"]14[/COLOR]'ANKARA
ie.document.all("doggun").selectedIndex = [COLOR="red"]30[/COLOR] '30
ie.document.all("dogay").selectedIndex = [COLOR="red"]5[/COLOR] '5
ie.document.all("dogyil").selectedIndex = [COLOR="red"]31[/COLOR] '1960
Application.Wait (Now + TimeValue("00:00:01"))
ie.document.getelementsbytagname("input")(1).Click
'ie.Quit: Set ie = Nothing
End With
MsgBox ("Bitti  ")
End Sub
 
Katılım
22 Ekim 2011
Mesajlar
261
Excel Vers. ve Dili
2013
Halit bey;
Yardımcı olduğunuz için teşekkür ederim.
Doğum tarihi Yılını 2 hane alıyor. Dört hane girince kabul etmiyor.
 

halit3

Uzman
Uzman
Katılım
18 Ocak 2008
Mesajlar
12,758
Excel Vers. ve Dili
2003 excell türkçe
ve
2007 excell türkçe
Örnek 1960 yılı için 31 yazılacak
ie.document.all("dogyil").selectedIndex = 31

1930 için 1 yazılacak
1966 için 37 yazılacak

yapacaksınız
 

halit3

Uzman
Uzman
Katılım
18 Ocak 2008
Mesajlar
12,758
Excel Vers. ve Dili
2003 excell türkçe
ve
2007 excell türkçe
Bu kodu bir dene

HTML:
Sub GirisCikisBildirgesiTOPLU()
Dim URL As String

Dim ie As Object
URL = "https://uyg.sgk.gov.tr/AylikHesap/"
Set ie = CreateObject("InternetExplorer.Application")
With ie
.navigate URL
.Visible = 1
Do Until ie.ReadyState = 4: DoEvents: Loop
Do While ie.Busy: DoEvents: Loop
ie.document.All("mernisno").Value = 12345678912#
ie.document.All("sicilno").Value = 12345678
ie.document.All("babaadi").Value = 85568329

For k = 1 To ie.document.All("ilkodu").Length - 1
If ie.document.All.ilkodu(k).Text = "ANKARA" Then
ie.document.All("ilkodu").Focus
ie.document.All("ilkodu").selectedindex = k
Exit For
End If
Next k


ie.document.All("doggun").selectedindex = 30 '30
ie.document.All("dogay").selectedindex = 5 '5


For t = 1 To ie.document.All("dogyil").Length - 1
If ie.document.All.dogyil(t).Text = "1966" Then
ie.document.All("dogyil").Focus
ie.document.All("dogyil").selectedindex = t
Exit For
End If
Next t


Application.Wait (Now + TimeValue("00:00:01"))
ie.document.getelementsbytagname("input")(1).Click
'ie.Quit: Set ie = Nothing
End With
MsgBox ("Bitti  ")
End Sub
 
Üst