fork download
  1. Sub WhatsAppMsg()
  2. Dim LastRow As Long
  3. Dim i As Integer
  4. Dim strip As String
  5. Dim strPhoneNumber As String
  6. Dim strmessage As String
  7. Dim strPostData As String
  8. Dim IE As Object
  9.  
  10. LastRow = Range("A" & Rows.Count).End(xlUp).Row
  11. For i = 2 To LastRow
  12.  
  13. strPhoneNumber = Sheets("Data").Cells(i, 1).Value
  14. strmessage = Sheets("Data").Cells(i, 2).Value
  15.  
  16. 'IE.navigate "whatsapp://send?phone=phone_number&text=your_message"
  17.  
  18. strPostData = "whatsapp://send?phone=" & strPhoneNumber & "&text=" & strmessage
  19. Set IE = CreateObject("InternetExplorer.Application")
  20.  
  21. IE.navigate strPostData
  22. Application.Wait Now() + TimeSerial(0, 0, 5)
  23. SendKeys "~"
  24.  
  25. Next i
  26. End Sub
  27.  
  28.  
  29.  
Success #stdin #stdout 0.02s 25996KB
stdin
Standard input is empty
stdout
Sub WhatsAppMsg()
Dim LastRow As Long
Dim i As Integer
Dim strip As String
Dim strPhoneNumber As String
Dim strmessage As String
Dim strPostData As String
Dim IE As Object

LastRow = Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To LastRow

strPhoneNumber = Sheets("Data").Cells(i, 1).Value
strmessage = Sheets("Data").Cells(i, 2).Value

'IE.navigate "whatsapp://send?phone=phone_number&text=your_message"

strPostData = "whatsapp://send?phone=" & strPhoneNumber & "&text=" & strmessage
Set IE = CreateObject("InternetExplorer.Application")

IE.navigate strPostData
Application.Wait Now() + TimeSerial(0, 0, 5)
SendKeys "~"

Next i
End Sub