Send message using excel to whatsapp web reloading

0 votes

Hello, I have the code to transmit messages from Excel to WhatsApp, however each time I use it, WhatsApp Web starts in a new tab rather than using the one that is already open. (When using Chrome)

Code.

Sub Test()

    Dim text As String
    Dim contact As String
    text = Range("C2").Value
    ActiveWorkbook.FollowHyperlink Address:=" https://web.whatsapp.com/"
    If MsgBox("Is WhatsApp Loaded?" & vbNewLine & vbNewLine & "Press No To Cancel", vbYesNo + vbQuestion + vbSystemModal, "WhatsApp") = vbYes Then
        Fazer (100)
        startrow = 2
        startcol = 2
        Do Until Sheets(1).Cells(startrow, 1) = ""
            contact = Cells(startrow, 1)
            text1 = Sheets(1).Cells(startrow, startcol).Value
            Fazer (3000)
                Call SendKeys("{TAB}", True)
            Fazer (1000)
                Call SendKeys(contact, True)
            Fazer (1000)
                Call SendKeys("~", True)
            Fazer (1000)
                Call SendKeys(text1, True)
            Fazer (1000)
                Call SendKeys("~", True)
            Fazer (1000)
            startrow = startrow + 1
        Loop
    Else
    End If
End Sub

Function Fazer(ByVal Acao As Double)
    Application.Wait (Now() + Acao / 24 / 60 / 60 / 1000)
End Function

Can someone please help me with this?

Sep 20, 2022 in Others by Kithuzzz
• 38,000 points
6,819 views

1 answer to this question.

0 votes

Inputs

  1. Range("W_C") = A list of Contacts' telephone numbers
  2. Range("W_N") = Selected Contact Number
  3. Range("W_M") = WhatsApp Message (text)
  4. Range("W_L") = Complete WhatsApp Hyperlink (formula ... =HYPERLINK("https://web.whatsapp.com/send?phone="&TRIM(W_N)&"&text="&W_M)

I hope this helps you. 

answered Sep 21, 2022 by narikkadan
• 63,600 points

Related Questions In Others

0 votes
2 answers

How to copy a formula horizontally within a table using Excel VBA?

Hi so basically, create an adjacent column ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,690 points
1,053 views
0 votes
1 answer

How to convert data from txt files to Excel files using python

Hi , there are few steps to ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,690 points
14,024 views
0 votes
1 answer
0 votes
0 answers

Convert Rows to Columns with values in Excel using custom format

1 I having a Excel sheet with 1 ...READ MORE

Feb 17, 2022 in Others by Edureka
• 13,690 points
975 views
0 votes
1 answer

Excel VBA - Trouble importing WhatsApp chat history files into an Excel sheet

Since the OpenText method isn't working for ...READ MORE

answered Oct 14, 2022 in Others by narikkadan
• 63,600 points
717 views
0 votes
1 answer

Retrieve epay.info Balance with VBA and Excel

This code should log you in, provided ...READ MORE

answered Sep 5, 2018 in Blockchain by digger
• 26,740 points
1,211 views
0 votes
1 answer

How to load file to Excel Power query from SFTP site

Currently, I don't think there is a ...READ MORE

answered Dec 3, 2018 in Power BI by Upasana
• 8,620 points
3,662 views
0 votes
1 answer

Using VBA Excel to create a gramatically correct list

The Excel AND function is a logical ...READ MORE

answered Feb 9, 2022 in Others by gaurav
• 23,260 points
906 views
0 votes
1 answer

Excel web query to login into a website

To be recognized by the web server ...READ MORE

answered Sep 21, 2022 in Others by narikkadan
• 63,600 points
2,941 views
0 votes
1 answer

Unable to import data in excel from another website using VB code

Replace : Set ieTable = ieDoc.all.Item("report-table") With: Set ieTable = ...READ MORE

answered Sep 21, 2022 in Others by narikkadan
• 63,600 points
780 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP