Automatically Send Message with Image Via Whatsapp @Exceltrainingvideos
Automatically Send Message with Image Via Whatsapp  @Exceltrainingvideos
Uploaded September 2020 | Updated September 2026, 1 week ago
How to automatically send message with image via Whatsapp using VBA.
Here's the complete VBA code:
Option Explicit

Sub SendMessageWithPicViaWhatsapp()
Dim ie As InternetExplorer
Set ie = New InternetExplorer
Dim mytext As String
Dim myDir As String
mytext = Sheet1.Range("C2")

Dim myObj
Dim Pictur

Set myObj = ActiveSheet.DrawingObjects
For Each Pictur In myObj
If Left(Pictur.Name, 7) = "Picture" Then
Pictur.Select
Pictur.Delete
End If
Next

Dim EmployeeName As String, T As String

myDir = "C:\Users\takyar\Pictures\employees\"
EmployeeName = Range("A2") & Range("B2")
T = ".jpg"

On Error GoTo errormessage:

EmployeeName = Range("A2") & Range("B2")

ActiveSheet.Shapes.AddPicture Filename:=myDir & EmployeeName & T, linktofile:=msoFalse, _
savewithdocument:=msoTrue, Left:=240, Top:=15, Width:=60, Height:=60

errormessage:
If Err.Number = 1004 Then
MsgBox "File does not exist." & vbCrLf & "Check the name of the employee!"
Range("A2").Value = ""
Range("B2").Value = ""
End If

ActiveSheet.Shapes(1).Copy

ie.navigate "web.whatsapp.com/send?phone=919810081867&text=" & mytext

Application.Wait (Now + TimeValue("00:00:10"))

Call SendKeys("^v")
Call SendKeys("{ENTER}", True)
Application.Wait (Now + TimeValue("00:00:05"))
Call SendKeys("{ENTER}", True)

End Sub

Refer to this video on how to add an appropriate image to a worksheet:
exceltrainingvideos.com/how-to-display-pictures-on-excel-worksheet-using-vba
Automatically Send Message with Image Via WhatsappSuper Quick Method to UNSTACK One Column of Data into Multiple ColumnsCreate Dynamic User Form with two Dependent Combo BoxesRemove Blank RowsCreate Interactive ChecklistSuper Easy Secure Data Entry FormDisplay List of All Files in folder in Combo BoxXlookup functionCreate Multiple Slicers Using Table Data AutomaticallyAnimations for User InterfacesUnstack Multiple Columns of DataCreate Drop Down List to Display Shapes in Excel
Dinesh Kumar Takyar |

Automatically Send Message with Image Via Whatsapp

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER