Quantcast
Channel: NowSMS
Viewing all articles
Browse latest Browse all 92

Sending SMS from Microsoft Excel

$
0
0

A recent posting on the NowSMS Discussion Board has some interesting information on sending an SMS a link within an Excel spreadsheet.

The gist of the posting is that you cannot use the Excel HYPERLINK command to do this. It would be logical to build a NowSMS URL to send a message, but the HYPERLINK command connects to the URL twice, resulting in duplicate messages being sent.
As an alternative, Des created a VBScript macro instead. This macro initiates an HTTP connection to NowSMS to send a message, dynamically creating a message based upon cell values in the Excel spreadsheet. I’ve quoted the details from Des below:

The alternative approach is to write a simple VBScript macro instead.

Today was my first attempt at writing one … but I did manage to create a button in a spreadsheet, where when you click on the button, it reads data from the spreadsheet to send out an SMS.

Here’s what I did …

From the Developer menu in Excel, I added an Active X Command Button.

I then associated the following code with my command button:

Private Sub CommandButton1_Click()
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
URL = "http://192.168.0.222:8800/"
objHTTP.Open "POST", URL, False
objHTTP.send ("&PhoneNumber=" + Range("a9").Text + "&text=" + Range("a10").Text)
End Sub

In this particular case, I am extracting the phone number from cell A9, and the text to send from A10.

Once I exit design mode, I can click on the button, and it triggers this code, which makes the HTTP submission to NowSMS.

I’m using HTTP POST instead of GET to avoid some URL encoding issues.

It’s not as easy as using HYPERLINK, but hopefully you can adapt this to your scenario.



Post any questions or commands in the discussion board posting at http://www.nowsms.com/discus/messages/1/41882.html.

Viewing all articles
Browse latest Browse all 92