using macro to send sms using http api

shahabm

New Member
Joined
Apr 5, 2015
Messages
5
greetings

i am trying to send out sms using an api
http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?username=username&password=password&sendername=sender id&mobileno=919999999999&message=Hello

i want to get the mobileno from a cell in sheet7 of the workbook from "d" the cursor will be in the same row. just want the value from "d" to be picked up and used as mobile no
i found a code which works well with hard coded number in the mobileno, but getting an error when i try to pull the value . any help will be
[FONT=Arial, Helvetica, sans-serif]appreciated

Code:
[/COLOR][/FONT]Sub SendSms()

    Dim URL As String
    Dim rng As Range
    
 
    URL = "[COLOR=#000000][FONT=Arial]http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?username=username&password[/FONT][/COLOR][COLOR=#000000][FONT=Arial]=password&sendername=sender id[/FONT][/COLOR]&mobileno=& ThisWorkbook.Worksheets(7).rng.Row("d:d").Value & "&message=Hi test"
        
    Dim xml As Object
    Set xml = CreateObject("MSXML2.XMLHTTP")
    xml.Open "GET", URL, False
    xml.Send
End Sub


[FONT=Arial, Helvetica, sans-serif][COLOR=#000000]


thanks
[/FONT]
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Try:
Code:
    URL = "http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?username=username&password=password&sendername=sender id&mobileno=" & Cells(ActiveCell.Row, "D").Value & "&message=Hi test"
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top