Esta macro que os pongo a continuación envía un mensaje de texto y foto a una lista de teléfonos que le pongas en el Excel. Funciona perfectamente, el único inconveniente es que todos los teléfonos tienen que estar en la agenda, si algún teléfono no esta en la agenda se cuelga y deja de enviar. ¿Hay alguna manera de hacer que si un numero no está en la agenda no haga nada y pase al siguiente numero?
Gracias por prestarme atención
La macro:
Sub EnvíoMensajesW2()
Dim Teléfono As String
Dim Imagen As String
Dim Texto As String
For Each Celda In Envío.Range("Clientes[TELÉFONO]")
Buenas tardes a todos
Esta macro que os pongo a continuación envía un mensaje de texto y foto a una lista de teléfonos que le pongas en el Excel. Funciona perfectamente, el único inconveniente es que todos los teléfonos tienen que estar en la agenda, si algún teléfono no esta en la agenda se cuelga y deja de enviar. ¿Hay alguna manera de hacer que si un numero no está en la agenda no haga nada y pase al siguiente numero?
Gracias por prestarme atención
La macro:
Sub EnvíoMensajesW2()
Dim Teléfono As String
Dim Imagen As String
Dim Texto As String
For Each Celda In Envío.Range("Clientes[TELÉFONO]")
With Envío
Teléfono = Celda.Value
Texto = Celda.Offset(0, 6).Value
Imagen = Celda.Offset(0, 7).Value
.Pictures.Insert(Imagen).Name = "ImagenW"
.Shapes("ImagenW").Copy
AppActivate "WhatsApp"
Application.Wait (Now + TimeValue("00:00:03"))
SendKeys "^f", True
Application.Wait (Now + TimeValue("00:00:03"))
SendKeys Teléfono, True
Application.Wait (Now + TimeValue("00:00:03"))
SendKeys "{Tab}", True
Application.Wait (Now + TimeValue("00:00:03"))
SendKeys "~", True
Application.Wait (Now + TimeValue("00:00:03"))
SendKeys Texto, True
Application.Wait (Now + TimeValue("00:00:03"))
SendKeys "~", True
Application.Wait (Now + TimeValue("00:00:03"))
SendKeys "^v", True
Application.Wait (Now + TimeValue("00:00:03"))
SendKeys "~", True
.Shapes("ImagenW").Delete
End With
Next Celda
End Sub