Pessoal,
durante as minhas pesquisas encontrei uma solução bem útil.
Os créditos para o colega Suebersson Montalvão.
https://www.youtube.com/watch?v=kqlvXpJ0mBQ
Código: Selecionar todos
Sub Enviar()
'não pode fazer clicks ou mudar o foco do mouse nem pressionar teclas
Dim text As String
Dim Contato As String
text = Sheets(1).TextBox1
If text = "" Then
MsgBox "Digite a Mensagem a ser envida!", 64, "ERRO DE PROCEDIMENTO"
Exit Sub
End If
'ActiveWorkbook.FollowHyperlink Address:=" https://web.whatsapp.com/"
Shell "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" & " https://web.whatsapp.com/"
Fazer (15000)
linha = 2
Do Until Sheets(1).Cells(linha, 1) = ""
Fazer (2000)
Contato = Cells(linha, 1)
If Contato = "" Then
MsgBox "Preencha os endereços de contatos!", 64, "Insira pelo menos um Contato"
Exit Sub
End If
Fazer (3000)
Call SendKeys("{TAB}", True)
Call SendKeys(Contato, True)
Call SendKeys("~", True)
Fazer (8000)
Call SendKeys(text, True)
'SendKeys "{ENTER}", True
Call SendKeys("~", True)
linha = linha + 1
Loop
'ActiveWorkbook.FollowHyperlink Address:=" https://web.whatsapp.com/"
'Shell "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" & " https://web.whatsapp.com/"
' 'Application.Wait TimeSerial(0, 0, 1)
' Fazer (7000)
' SendKeys "{TAB}", True
'' SendKeys "camilly", True
' Call SendKeys(text, True)
'SendKeys "{ENTER}", True
'
'Fazer (2000)
'Call SendKeys(text, True)
'SendKeys "{ENTER}", True
'Call SendKeys("~", True)
End Sub
Function Fazer(ByVal Acao As Double)
Application.Wait (Now() + Acao / 24 / 60 / 60 / 1000)
'milliSeconds
End Function
Sub teste()
Fazer (5000)
MsgBox "suel"
End Sub
Abs