I have designed a code that sends a message from excel to WhatsApp to list of contacts, it works fine for single contact but when , more than one contact is added it doesn't move to that contacts instead paste other contact names & messages in the message box of the first contact. Here is the excel view, when I press the button the output which is Whatsapp web page doest work as desired as seen in picture.
I know there is some small bug but any support for resolution of this issue will be highly appreciated. Here is the code
Sub Test()
Dim text As String
Dim contact As String
text = Range("C2").Value
ActiveWorkbook.FollowHyperlink Address:=" https://web.whatsapp.com/"
If MsgBox("Is WhatsApp Loaded?" & vbNewLine & vbNewLine & "Press No To Cancel", vbYesNo + vbQuestion + vbSystemModal, "WhatsApp") = vbYes Then
Fazer (100)
startrow = 2
startcol = 2
Do Until Sheets(1).Cells(startrow, 1) = ""
contact = Cells(startrow, 1)
text1 = Sheets(1).Cells(startrow, startcol).Value
Fazer (3000)
Call SendKeys("{TAB}", True)
Fazer (1000)
Call SendKeys(contact, True)
Fazer (1000)
Call SendKeys("~", True)
Fazer (1000)
Call SendKeys(text1, True)
Fazer (1000)
Call SendKeys("~", True)
Fazer (1000)
startrow = startrow + 1
Loop
Else
End If
End Sub
Function Fazer(ByVal Acao As Double)
Application.Wait (Now() + Acao / 24 / 60 / 60 / 1000)
End Function