How to Send Bulk Message on Whatsapp by Excel (with VBA Code)

5/5 - (3 votes) Rate this Post!

Sending bulk messages on WhatsApp using VBA code is not a straightforward task, as WhatsApp does not provide any official API or support for automation. However, it is possible to use some workarounds to achieve this.

How to Send Bulk Message on Whatsapp by Excel (with VBA Code)

Here are the steps you can follow to create a VBA code to send bulk messages on WhatsApp:

  1. First, you need to install the WhatsApp desktop application on your computer.
  2. Next, you can use a library called “Selenium” to control the WhatsApp desktop application through VBA code. Selenium is a browser automation tool that allows you to write scripts to automate interactions with websites.
  3. To use Selenium with VBA, you will need to install the Selenium VBA wrapper. This can be done by downloading the wrapper from the following link: https://github.com/florentbr/SeleniumBasic/releases
  4. After installing the wrapper, you can start writing your VBA code to automate WhatsApp. Here is an example of how you can send a message to a particular contact using Selenium and VBA.
  5. You can modify this code to send messages to multiple contacts by looping through a list of contacts and sending the message to each of them. You can also use variables to specify the message and the list of contacts.

Sub SendWhatsAppMessage()
Dim driver As New Selenium.WebDriver
Dim message As String

message = “This is a test message”

‘ Start the WhatsApp desktop application
driver.Start “chrome”, “https://web.whatsapp.com”

‘ Wait for the application to load
driver.Wait (20)

‘ Find the contact you want to send the message to
driver.FindElementById(“side”).FindElementsByClass(“_1wjpf”).Click

‘ Wait for the chat window to load
driver.Wait (5)

‘ Find the text input field and send the message
driver.FindElementById(“main”).FindElementByClass(“_3uMse”).SendKeys message

‘ Find the send button and click it
driver.FindElementById(“main”).FindElementByClass(“_1U1xa”).Click
End Sub

Download VBA Code

I hope this helps! Let me know if you have any questions or need further assistance.

Leave a Comment