VBA code - send sms via webpage

flaviu123

New Member
Joined
Aug 20, 2014
Messages
44
Good evening!


Can someone help me with a VBA code that uses IE to send SMS on mobile phone? There are many sites that offer this service, one of them would be: Trimite sms gratis in romania vodafone, orange, cosmote, digimobil - send free sms in romania - Senden Sie kostenlose SMS in rumanien - 55, by simply login with Facebook account.


I want a code to send message automatically if the value cell A1 in Sheet 1 is 1 on the phone number in A2 with message text contain values ​​in cells (A1: D1) in Sheet 2.


Excuse me for English
I appreciate any help from your!
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Thanks for your time. I tried to adapt the code but my knowledge in VBA is minimal, and I have not been successful. Look, what I tried:
Code:
Sub submitFeedback3()    Application.ScreenUpdating = False


    Set IE = CreateObject("InternetExplorer.Application")
    IE.Visible = True
    IE.Navigate "http://rosms.eu/"


    Application.StatusBar = "Submitting"
    ' Wait while IE loading...
    While IE.Busy
        DoEvents
    Wend
    ' **********************************************************************
    delay 5

    IE.Document.getElementById("Numar de telefon:-1372700847").Value = "0723XXXXXX"
    delay 5
    IE.Document.getElementById("Mesaj:-1372700847").Value = "ddddddddddd2"
    delay 5
    IE.Document.getElementById("Trimite mesaj-1-1372700847").Click
    '**********************************************************************
    Application.StatusBar = "Form Submitted"
    IE.Quit
    Set IE = Nothing


    Application.ScreenUpdating = True
End Sub


Private Sub delay(seconds As Long)
    Dim endTime As Date
    endTime = DateAdd("s", seconds, Now())
    Do While Now() < endTime
        DoEvents
    Loop
End Sub

and crashes to: IE.Document.getElementById("Numar de telefon:-1372700847").Value = "0723XXXXXX"
 
Upvote 0
I have just checked, and the line should be
IE.Document.getElementById("nr") not what you used.

To find the name of the element, click on View Source, of the web page.
Search for the heading you're looking for.

you should see:
Numar Telefon:
<br/>
<input name="nr"


repeat this process for the other fields.

Instead of using a value, you can use a cell reference so you don't have to change the code.
 
Upvote 0
Thanks, I did with the this code:
Code:
Sheets("Sheet4").Select
'copy the phone number
objIE.Document.getElementById("nr").Value = ActiveSheet.Range("I1").Value
    
   Sheets("Sheet4").Select
'copy text message
    Set frm = objIE.Document.getElementsByTagName("form").Item(rep)
    If frm.Name = "smsz" Then
             frm.sms.Value = ActiveSheet.Range("J1").Value
      End If
      'send message
       Set frm = objIE.Document.getElementsByTagName("form").Item(rep)
        If frm.Name = "smsz" Then
             frm.submit.Click
       End If

But what do you think of? http://www.mrexcel.com/forum/excel-...ications-auto-login-flash-player-website.html
 
Upvote 0

Forum statistics

Threads
1,213,517
Messages
6,114,089
Members
448,548
Latest member
harryls

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