Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public texto, texto2, texto3 As String
- Sub Enviar()
- Application.ScreenUpdating = False
- 'não pode fazer clicks ou mudar o foco do mouse nem pressionar teclas
- Dim Contato As String
- 'Plan4.Visible = 1
- Plan4.Select
- Plan4.Range("A2").Select
- Selection.ListObject.QueryTable.Refresh BackgroundQuery:=False
- 'Plan4.Visible = 2
- Plan1.Select
- OpenInGoogleChromeNewTab "http://web.whatsapp.com"
- End Sub
- Sub OpenInGoogleChromeNewTab(url As String)
- pathFireFox = "C:\Program Files\Google\Chrome\Application\chrome.exe"
- 'para newtab usar esse -new-tab
- Shell """" & pathFireFox & """" & " -new-tab " & url, vbHide
- Fazer (15000)
- linha = 7
- 'Do Until Plan1.Cells(linha, 4) = ""
- Fazer (10000)
- If Range("A1").Value > 0 Then
- Contato = Plan1.Cells(linha, 4)
- Else
- Contato = Plan1.Cells(linha, 4)
- End If
- 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)
- If Range("A1").Value > 0 Then
- Call SendKeys(Range("B4").Value, True)
- Else
- For i = 1 To 9
- Call SendKeys(Range("B" & i + 6).Value, True)
- SendKeys "+{ENTER}", True
- Next
- End If
- SendKeys "{ENTER}", True
- Call SendKeys("~", True)
- linha = linha + 1
- 'Loop
- Fazer (180000)
- Call SendKeys("%{F4}", True)
- End Sub
- Function Fazer(ByVal Acao As Double)
- Application.Wait (Now() + Acao / 24 / 60 / 60 / 1000)
- 'milliSeconds
- End Function
- Private Sub Atualiza()
- '
- ' Atualiza Macro
- '
- ' Atalho do teclado: Ctrl+k
- Application.ScreenUpdating = False
- 'Plan4.Visible = 1
- Plan4.Select
- Plan4.Range("A2").Select
- Selection.ListObject.QueryTable.Refresh BackgroundQuery:=False
- ' Plan4.Visible = 2
- Plan5.Select
- MsgBox ("Atualizado com sucesso!!"), vbInformation, "Atenção!'"
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement