Hello, I have the code to transmit messages from Excel to WhatsApp, however each time I use it, WhatsApp Web starts in a new tab rather than using the one that is already open. (When using Chrome)
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
Can someone please help me with this?