Sending SMS by VBA Code

Sachin2k6

Active Member
Joined
Mar 3, 2012
Messages
369
Hi all,

Sorry for violating the forum rules but i have to restart the thread as the original have a lot of confusing replies.

I'm working on a management program for a small company. As one of it's feature i need a procedure which send a prewritten SMS to it's employees using a web service like 160by2.com (10 employees at a time.).

After a long search in forum, with the help of found codes i managed the following code and login successfully on the site 160by2.com


Code:
[I]Sub SendSMS()

Const cURL = "http:\\www.160by2.com"
Const cUsername = "XXXXX" 'REPLACE XXXX WITH YOUR USER NAME
Const cPassword = "YYYYY" 'REPLACE YYYY WITH YOUR PASSWORD

Dim IE As InternetExplorer
Dim doc As HTMLDocument
Dim LoginForm As HTMLFormElement
Dim UserNameInputBox As HTMLInputElement
Dim PasswordInputBox As HTMLInputElement
Dim SignInButton As HTMLInputButtonElement
Dim HTMLelement As IHTMLElement

Set IE = New InternetExplorer

IE.Visible = True
IE.navigate cURL

'Wait for initial page to load

Do While IE.readyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop

Set doc = IE.document

'Get the only form on the page

Set LoginForm = doc.forms(0)

'Get the User Name textbox and populate it

Set UserNameInputBox = LoginForm.elements("username")
UserNameInputBox.Value = cUsername

'Get the password textbox and populate it

Set PasswordInputBox = LoginForm.elements("password")
PasswordInputBox.Value = cPassword

'Get the form input button and click it

Set SignInButton = LoginForm.elements("button")
SignInButton.Click

'Wait for the new page to load

Do While IE.readyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop


'Login succeeded here.

End Sub
[/I]

But to proceed further and access the send sms page i can't get the elements of the next page to click that.

How this code can be extended to access send sms page and send an sms to a particular number(s)????
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
I'm intrigued, what would that offer that can't be done from Excel?

You can use it to start Excel. :)

It allows manipulation of the windows environment (keyboard, mouse, environment variables, etc...). You can use it to execute programs and interact with the app just as a user would. I mainly use it to automate mundane tasks. But I'm not using it anywhere near its potential.
 
Upvote 0
hmmm, how would it help here? You can control IE from within Excel directly with intellisense
 
Upvote 0
MUST the solution be in Excel? Can you use another software tool in the solution?

If so, I suggest AutoItScript - AutoItScript Website? It's a scripting tool that may be of help.

You could have the Excel script execute the Autoit script.

I can't understand how this utility help me regarding this task. I have the database of employees in a excel sheet and i can fill their mob. numbers to the web page only from there either manually or by VBA code which is not impossible in my thought.
 
Upvote 0

Forum statistics

Threads
1,216,058
Messages
6,128,539
Members
449,457
Latest member
ncguzzo

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