Send WhatsApp Message From Excel Sheet

By making some changes to the Excel address book template that I created earlier, I created links to web.whatsapp.com for mobile phone numbers – also the mobile numbers are controlled by the macro – .  If the number is valid  (with the international code at the beginning) and the user has the WhatsApp application installed on their phone, you can send a message even if the number is not stored on your smart phone.

📥 Read more & download sample file

Place A Userform Next To The Clicked Cell

It may be more useful to display this userform next to the active cell that was clicked, rather than in the center of the sheet.

By declaring the GetDeviceCaps , GetDC , ReleaseDC

functions , I repositioned the userform next to each the clicked

activecell .(The template is checked in 32-bit and 64-bit Excel versions .)

“Type POINTAPI

X As Long

Y As Long

End Type

#If VBA7 Then

Declare PtrSafe Function GetDeviceCaps Lib “gdi32” (ByVal hDc As LongPtr, ByVal nIndex As Long) As Long

Declare PtrSafe Function GetDC Lib “user32” (ByVal hwnd As LongPtr) As LongPtr

Declare PtrSafe Function ReleaseDC Lib “user32” (ByVal hwnd As LongPtr, ByVal hDc As LongPtr) As Long

Dim hDc As LongPtr

#Else

Declare Function GetDeviceCaps Lib “gdi32” (ByVal hDc As Long, ByVal nIndex As Long) As Long

Declare Function GetDC Lib “user32” (ByVal hwnd As Long) As Long

Declare Function ReleaseDC Lib “user32” (ByVal hwnd As Long, ByVal hDc As Long) As Long

Dim hDc As Long

#End If

📥 Read more & download sample file