Skip to content

Instantly share code, notes, and snippets.

@mtahiryilmazz
Created November 14, 2023 15:30
Show Gist options
  • Save mtahiryilmazz/55dfc95852fa92cb52ceaab6abc2e2b3 to your computer and use it in GitHub Desktop.
Save mtahiryilmazz/55dfc95852fa92cb52ceaab6abc2e2b3 to your computer and use it in GitHub Desktop.
Excel SGK Giriş (IE ve Selenium Yok)
Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As LongPtr, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Sub SGKGiris()
Dim url As String
Dim tcKimlikNo As String
Dim isyeriKodu As String
Dim sistemSifre As String
Dim isyeriSifre As String
' Açmak istediğiniz web sayfasının URL'sini belirtin
url = "https://uyg.sgk.gov.tr/SigortaliTescil/amp/loginldap"
' Kullanıcı bilgileri
tcKimlikNo = "1111"
isyeriKodu = "2222"
sistemSifre = "3333"
isyeriSifre = "4444"
' Chrome'u başlat ve belirtilen URL'yi aç
ShellExecute 0, "open", "msedge.exe", url, "", 1
' Bir süre bekleyin (tarayıcı yüklenene kadar)
Application.Wait (Now + TimeValue("0:00:05"))
' Kullanıcı bilgilerini doldur (SendKeys ile)
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys tcKimlikNo
SendKeys "{TAB}"
SendKeys isyeriKodu
SendKeys "{TAB}"
SendKeys sistemSifre
SendKeys "{TAB}"
SendKeys isyeriSifre
End Sub
Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As LongPtr, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Sub SGKGiris()
Dim url As String
Dim tcKimlikNo, isyeriKodu, sistemSifre, isyeriSifre As String
' Açmak istediğiniz web sayfasının URL'sini belirtin
url = "https://uyg.sgk.gov.tr/SigortaliTescil/amp/loginldap"
' Kullanıcı bilgileri
tcKimlikNo = "1111"
isyeriKodu = "2222"
sistemSifre = "3333"
isyeriSifre = "4444"
' Chrome'u başlat ve belirtilen URL'yi aç
Call ShellExecute(0, "open", "msedge.exe", url, "", 1)
' Bir süre bekleyin (tarayıcı yüklenene kadar)
Application.Wait (Now + TimeValue("0:00:05"))
' Kullanıcı bilgilerini doldur (SendKeys ile)
SendKeys "{TAB}" & "{TAB}" & "{TAB}"
SendKeys tcKimlikNo & "{TAB}" & isyeriKodu & "{TAB}" & sistemSifre & "{TAB}" & isyeriSifre
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment