Skip to content

Free Excel Training Videos

Excel Training Tutorials with Videos

  • Home
    • About
    • Contact
    • Privacy Policy
  • Excel Essentials
  • Excel Functions
    • Excel 2003
    • Excel 2007
    • Excel 2010
  • Excel in Hindi
  • Excel VBA
    • Excel 2003 VBA
    • Excel 2007 2010 2013 VBA
  • What’s New
  • YouTube
    • YouTube Advanced VBA
    • YouTube Hindi
  • Books

Recent Posts

  • Analyze Large Amounts of Data in Excel
  • Copy Paste PDF Data into Excel
  • PDF to Excel Using Power Query
  • Print Latest Data
  • Sending Reminder from Excel Using Gmail with CDO
  • Forward Message via whatsapp Desktop
  • Whatsapp Desktop Automation with VBA
  • Upload Image PDF and Video files automatically via Whatsapp
  • Unstack Multiple Columns of Data
  • Automatically Send Message with Image via Whatsapp
  • Create Folders and Files Automatically
  • Automatically Highlight Column Header
  • Import Data from Multiple Worksheets in Multiple Workbooks Using Power Query
  • Combine Worksheets Data Using Power Query
  • Power BI Desktop Data Analysis Visualizations
  • Copying Rows between Workbooks Based on Text Value
  • Xlookup function
  • List Files in Folder Create Hyperlink
  • Hide Show Ribbon in Excel Using VBA
  • Extract Data from Word Document Using Word and Excel VBA

Tag: Whatsapp Desktop Automation with VBA

Whatsapp Desktop Automation with VBA

How to automate Whatsapp Desktop to login, search for user, send message and attachment and logout.

Watch the video below:

Whatsapp Desktop Automation with VBA

Here’s the complete macro or VBA code:
Option Explicit
Dim driver As New WebDriver
Sub LoginSearchUserSendMessageAttachmentViaWhatsapp()
‘Chrome Driver
‘Selenium
‘Selenium Wrapper

Dim keys As New SeleniumWrapper.keys
Dim filepath As String

filepath = “C:\exceltrainingvideos-12\find-header-with-todays-date.xlsm”

driver.Start “chrome”
driver.Get “https://web.whatsapp.com/”
driver.Window.Maximize

driver.Wait 5000

‘driver.Wait 2000
driver.FindElementByXPath(“//span[@title = ‘Dt’]”).Click
driver.Wait 1000
driver.SendKeys (keys.Tab + keys.Tab)
driver.Wait 1000
driver.SendKeys (“Poonam Mobile”)
driver.Wait 1000
driver.SendKeys (keys.Enter)

driver.FindElementByClass (“_3FRCZ”)
driver.SendKeys (“Please study the below attached file for the class tomorrow.”)
driver.Wait 1000
driver.SendKeys (keys.Enter)

driver.Wait 2000
driver.FindElementByXPath(“//div[@title=’Attach’]”).Click

driver.Wait 10000
driver.FindElementByXPath(“//input[@accept=’image/*,video/mp4,video/3gpp,video/quicktime’]”).SendKeys (filepath)

driver.Wait 2000 ‘ this wait time depends on the size of your file max 64 mb
driver.FindElementByXPath(“//span[@data-icon = ‘send’]”).Click

driver.Wait 1000
driver.FindElementByXPath(“//div[@title = ‘Menu’]”).Click
driver.FindElementByXPath(“//div[@title=’Log out’]”).Click

driver.Quit

End Sub

How to automate Whatsapp Desktop

Posted on January 14, 2021January 14, 2021Categories Excel VBATags search for user in whatsapp using vba, send message via whatsapp using vba, sign in whatsapp with vba, Whatsapp Desktop Automation with VBALeave a comment on Whatsapp Desktop Automation with VBA
Privacy Policy Mastering VBA for Microsoft Office 365

Proudly powered by WordPress