How to Send Push Notifications to Your Phone Using Excel & VBA
Language:
In this tutorial, I will show you, how you can send push notifications to your smartphone using Excel & VBA. We will be using the FREE “Pushbullet API” to send the notifications.
📝 Resources:
Download the Excel Template here:
Download Here
Pushbullet Website: https://www.pushbullet.com/
👩💻 Source Code:
Sub Send_PushNotification() Dim wb As Workbook Dim ws As Worksheet Dim pb_title As String Dim pb_title_input As String Dim pb_body As String Dim pb_body_input As String Dim ACCESS_TOKEN As String Dim Url As String Dim postData As String Dim Request As Object Set wb = ThisWorkbook Set ws = wb.Sheets("Sheet1") '======================================= 'CHANGE THE FOLLOWING ACCESS_TOKEN_INPUT = "YOUR ACCESS TOKEN" pb_title_input = "Title of the message" pb_body_input = "I am the body text" '======================================= 'Authentication ACCESS_TOKEN = "Bearer " & ACCESS_TOKEN_INPUT 'Variables pb_title = """" & pb_title_input & """" pb_body = """" & pb_body_input & """" 'Use XML HTTP Set Request = CreateObject("MSXML2.XMLHTTP") 'Specify Target URL Url = "https://api.pushbullet.com/v2/pushes" 'Open Post Request Request.Open "Post", Url, False 'Request Header Request.setRequestHeader "Authorization", ACCESS_TOKEN Request.setRequestHeader "Content-Type", "application/json;charset=UTF-8" 'Concatenate PostData postData = "{""type"":""note"",""title"":" & pb_title & ",""body"":" & pb_body & "}" 'Send the Post Data Request.send postData '[OPTIONAL] Get response text (result) MsgBox Request.responseText End Sub