WhatsApp Not stayed in same TAB (1 Viewer)

smtazulislam

Member
Local time
Today, 16:36
Joined
Mar 27, 2020
Messages
806
Hi, I using the google chrome browser. I would like to do if I click to whatsApp button then It is open chrome browser directly where I already opened a TAB.
But I facing every click open new tab in chrome browser. Also If I using the Gchrome as Object then get error.
How do I fix it.

Noted : Daily 40-50 whatsApp replying every single days. Same message just replace EmployeeID and NID Numbers. every click it was opened new tab with attached pciture.

Any help will be appreciate.
Code:
Option Compare Database
Option Explicit

Private Sub cmdWhatsApp_Click()
'Format : https://wa.me/whatsappphonenumber?text=urlencodedtext where whatsappphonenumber
'Dim Gchrome As Object
Dim strInput As String
Dim strMyNumbers As String

'Set Gchrome = CreateObject("chrome.Application")
strMyNumbers = "0096*******21"
strInput = "https://web.whatsapp.com/strMyNumbers"
Application.FollowHyperlink strInput, , True

'Set Gchrome = Nothing
End Sub
 

Attachments

  • WhatsApp.JPG
    WhatsApp.JPG
    19.1 KB · Views: 91

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 14:36
Joined
Jul 9, 2003
Messages
16,285
I noticed that you have yet to receive a reply. Hence I am bumping up your post so that it gets another look. I would say the information in your post is a little sparse, it might pay to add a bit more information.
 

Isaac

Lifelong Learner
Local time
Today, 06:36
Joined
Mar 14, 2017
Messages
8,778
Oh my.
If only it were true that we could just "create" all programs on our computer by just typing "chrome.applicaton" !! :)

I'm afraid you are confusing this with Office interoperability. There is no createobject("chrome.applicaton") exists.

Something like this might work:

Dim chromePath As String
chromePath = """C:\Program Files\Google\Chrome\Application\chrome.exe"""
Shell (chromePath & " -url http:google.ca")
 

smtazulislam

Member
Local time
Today, 16:36
Joined
Mar 27, 2020
Messages
806
Oh my.
If only it were true that we could just "create" all programs on our computer by just typing "chrome.applicaton" !! :)

I'm afraid you are confusing this with Office interoperability. There is no createobject("chrome.applicaton") exists.

Something like this might work:

Dim chromePath As String
chromePath = """C:\Program Files\Google\Chrome\Application\chrome.exe"""
Shell (chromePath & " -url http:google.ca")
Hello sir,
my code is worked. it was opening every click with new TAB in chrome browser.
I want to opened in previous TAB.
This is my question. Thank you.
Capture.PNG
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:36
Joined
Feb 19, 2013
Messages
16,627
have you looked at Chrome settings?
image_2022-12-11_185720091.png
 

smtazulislam

Member
Local time
Today, 16:36
Joined
Mar 27, 2020
Messages
806
Thank you.
No work. it was open a new TAB in the chrome as before.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:36
Joined
Feb 19, 2013
Messages
16,627
What code are you using to open chrome, perhaps try a different way as suggested by isaac
 

smtazulislam

Member
Local time
Today, 16:36
Joined
Mar 27, 2020
Messages
806
What code are you using to open chrome, perhaps try a different way as suggested by isaac
I dont try it. because Post : 1 code is worked.
I tried to your suggested to change the SETTING in chrome . But not working. it was opening with a new TAB.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:36
Joined
Feb 19, 2013
Messages
16,627
clearly your code ignores or bypasses the chrome setting - which tells you something about your code? i.e. it doesn't work for what you actually want
 

smtazulislam

Member
Local time
Today, 16:36
Joined
Mar 27, 2020
Messages
806
clearly your code ignores or bypasses the chrome setting - which tells you something about your code? i.e. it doesn't work for what you actually want
Yes sir,
can possible without open WhatsApp application in web. there have any system to sending message multiple WhatsApp numbers via ACCESS.

Everyday we have instruction to worker supervisor work schedule what to do next 2/3 hours. It was change the "EmployeeID" and "Department Name". Other almost messages is same.

Multiple Numbers:
if I create a form in a list box and selected multiple employee with add message text box (instruction details).

Or,
have any solution in other ways ?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:36
Joined
Feb 19, 2013
Messages
16,627
I don’t have a solution - usual way is to use sms instead
 

KitaYama

Well-known member
Local time
Today, 22:36
Joined
Jan 6, 2022
Messages
1,552
Or,
have any solution in other ways ?
We've been trying to do what you need for years, and failed. Chrome opens the links in a new tab by default. There are addins that control this behavior, but they all work within the browser. It means they can do their job if a link in a tab is clicked. They can do nothing against external links.
We couldn't find any way to make Chrome to reuse a tab.

We ended up not using Whatsapp web.

We installed WhatsApp for windows from here.
Then we create a bat file in our desktop that contains only one line:
start whatsapp:
When we want to open whatsapp via a form in Access, we run the bat file:
Shell "C:\Users\KitaYama\Desktop\Whatsapp.bat"

This is the closest way we could do what we need.
Still I'm interested if anyone else has a better way.
 
Last edited:

KitaYama

Well-known member
Local time
Today, 22:36
Joined
Jan 6, 2022
Messages
1,552
One more point.
By installing SeleniumBasic and re-use chrome driver, you can do a lot more in VBA.
This is a tutorial. There are more. Just search for SeleniumBasic.

 

KitaYama

Well-known member
Local time
Today, 22:36
Joined
Jan 6, 2022
Messages
1,552
And one last advice.
We had a lot of problems with WhatsApp.

We had to stop using WhatsApp and move to Microsoft Kaizala.
It's far better than WhatsApp with a lot more features for organization. WhatsApp is more for public.

Just give it a try. It's free and can be used by anyone.
 
Last edited:

Users who are viewing this thread

Top Bottom