Merhaba, sürekli yenilenen hücrede veri oluştukça telegram botumdan mesaj gelmesi için visual basic koduna ihtiyacım var. Elimde sadecce mesaj gönderme kodu var bunu hücre doldukça otomatik mesaj gönderecek şekilde ayarlamak istiyorum.
Sub SendMessage()
Dim objRequest As Object
Dim strChatId As String
Dim strMessage As String
Dim strPostData As String
Dim strResponse As String
strChatId = Value
strMessage = Value
strPostData = "chat_id=" & strChatId & "&text=" & strMessage
Set objRequest = CreateObject("MSXML2.XMLHTTP")
With objRequest
.Open "POST", "https://api.telegram.org/bot448817313:AAEwx3JKqx7ORbyUxlWMlYRzZUXxSeF_dhA/sendMessage?", False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.send (strPostData)
GetSessionId = .responseText
MsgBox GetSessionId
End With
End Sub
Sub SendMessage()
Dim objRequest As Object
Dim strChatId As String
Dim strMessage As String
Dim strPostData As String
Dim strResponse As String
strChatId = Value
strMessage = Value
strPostData = "chat_id=" & strChatId & "&text=" & strMessage
Set objRequest = CreateObject("MSXML2.XMLHTTP")
With objRequest
.Open "POST", "https://api.telegram.org/bot448817313:AAEwx3JKqx7ORbyUxlWMlYRzZUXxSeF_dhA/sendMessage?", False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.send (strPostData)
GetSessionId = .responseText
MsgBox GetSessionId
End With
End Sub
Son düzenleme: