bydogannn67
Altın Üye
- Katılım
- 6 Ocak 2016
- Mesajlar
- 226
- Excel Vers. ve Dili
- 2010 türkçe
Merhabalar,
Excelden web'e veri gönderirken internet bağlantısı koptuğunda hata ekranı geliyo bunun yerıne mesaj kutusu gelsin istiyorum ama beceremiyorum yardımcı olabilirmisiniz
Excelden web'e veri gönderirken internet bağlantısı koptuğunda hata ekranı geliyo bunun yerıne mesaj kutusu gelsin istiyorum ama beceremiyorum yardımcı olabilirmisiniz
Kod:
Private Sub CommandButton112_Click()
On Error GoTo hata
Dim URL As String
Dim IE As Object
On Error Resume Next
ThisWorkbook.Activate
If MsgBox(TextBox14.Text & " " & " - İLGİLİ KAYDA GİRİŞ YAPILSIN MI ? ", vbYesNo, "Dikkat") = vbNo Then Exit Sub
If TextBox15.Value = "" Or TextBox16.Value = "" Or TextBox17.Value = "" Or TextBox18.Value = "" Then
MsgBox "Lütfen listeden firma seçiniz...", vbCritical
Else
URL = "https://ebildirge.sgk.gov.tr/WPEB/amp/loginldap"
Set IE = CreateObject("https://uyg.sgk.gov.tr/IsvBildirimFormu/welcome.do")
With IE
.navigate URL
.Visible = 1
ShowWindow IE.hwnd, 3
Do Until IE.readyState = 4: DoEvents: Loop
Do While IE.Busy: DoEvents: Loop
IE.Document.all("kullaniciAdi").Value = TextBox15
IE.Document.all("isyeriKodu").Value = TextBox16
IE.Document.all("isyeriSifresi").Value = TextBox18
IE.Document.all("kaydet").Click
Do Until IE.readyState = 4: DoEvents: Loop
Do While IE.Busy: DoEvents: Loop
'ie.Quit: Set ie = Nothing
Else
hata:
MsgBox "İnternet bağlantısını kontrol edin", vbInformation
End With
End If
End Sub
