herkese günaydın.aşağıdaki makroda ssk müstahaklılık sorgulaması yapıyorum.sistem bazen sorgulamada zorluk çekiyor ve sistem donup kalıyor.benim istediğim başka bi butona basınca bu makro dursun..yeni sorgulamaya geçebileyim...şimdiden teşekkürler....
Sub SSK()
'SSK MÜSTAHAK
If UserForm1.CheckBox2 = True Then
On Error GoTo sorun3
UserForm1.Label15 = "Sorgulama Yapılıyor..."
Dim IE, objINPUT As Object
adres = "http://www.sgk.gov.tr/wps/portal/Portletler/Mustehaklik"
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = False
IE.Navigate adres
Do Until IE.ReadyState = 4: DoEvents: Loop
Do While IE.Busy: DoEvents: Loop
TC = UserForm1.TextBox1.Value
If TC = "" Or Len(TC) <> 11 Then TC = 99999999990#
TARİH = Format(Date, "dd.mm.yyyy")
With IE.Document.All
.tckText.Value = TC
.provTarihText.Value = TARİH
End With
For Each objINPUT In IE.Document.All.Tags("INPUT")
If objINPUT.Value = "GÖNDER" Then
objINPUT.Click
Exit For
End If
Next
Do Until IE.ReadyState = 4: DoEvents: Loop
Do While IE.Busy: DoEvents: Loop
Set bak = IE.Document.getelementsbytagname("td")
a = bak(40).innerhtml
If a = "MÜSTAHAKTIR" Then
UserForm1.Label15 = "SSK"
Set IE = Nothing
If UserForm1.TextBox1 = "" Then UserForm1.TextBox1.SetFocus
Else
UserForm1.Label15 = "SSK'lı DEĞİL..."
Set IE = Nothing
If UserForm1.TextBox1 = "" Then UserForm1.TextBox1.SetFocus
End If
Set IE = Nothing
If sorun3 = True Then
sorun3: UserForm1.Label15 = "Sistemde Hata Oluştu...!!!"
IE.Quit
If UserForm1.TextBox1 = "" Then UserForm1.TextBox1.SetFocus
Exit Sub
Set IE = Nothing
End If
End If
'SSK MÜSTAHAK
End Sub
Sub SSK()
'SSK MÜSTAHAK
If UserForm1.CheckBox2 = True Then
On Error GoTo sorun3
UserForm1.Label15 = "Sorgulama Yapılıyor..."
Dim IE, objINPUT As Object
adres = "http://www.sgk.gov.tr/wps/portal/Portletler/Mustehaklik"
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = False
IE.Navigate adres
Do Until IE.ReadyState = 4: DoEvents: Loop
Do While IE.Busy: DoEvents: Loop
TC = UserForm1.TextBox1.Value
If TC = "" Or Len(TC) <> 11 Then TC = 99999999990#
TARİH = Format(Date, "dd.mm.yyyy")
With IE.Document.All
.tckText.Value = TC
.provTarihText.Value = TARİH
End With
For Each objINPUT In IE.Document.All.Tags("INPUT")
If objINPUT.Value = "GÖNDER" Then
objINPUT.Click
Exit For
End If
Next
Do Until IE.ReadyState = 4: DoEvents: Loop
Do While IE.Busy: DoEvents: Loop
Set bak = IE.Document.getelementsbytagname("td")
a = bak(40).innerhtml
If a = "MÜSTAHAKTIR" Then
UserForm1.Label15 = "SSK"
Set IE = Nothing
If UserForm1.TextBox1 = "" Then UserForm1.TextBox1.SetFocus
Else
UserForm1.Label15 = "SSK'lı DEĞİL..."
Set IE = Nothing
If UserForm1.TextBox1 = "" Then UserForm1.TextBox1.SetFocus
End If
Set IE = Nothing
If sorun3 = True Then
sorun3: UserForm1.Label15 = "Sistemde Hata Oluştu...!!!"
IE.Quit
If UserForm1.TextBox1 = "" Then UserForm1.TextBox1.SetFocus
Exit Sub
Set IE = Nothing
End If
End If
'SSK MÜSTAHAK
End Sub
