Macro Question

chrysti

Board Regular
Joined
Dec 20, 2006
Messages
218
I have heard that there is a way to get a Macro to text a cell phone when it is done running??? Is this possible, and does anyone know the code that would allow me to do this???

Thanks in advance!!! This would be a lifesaver!!!

Chrysti :LOL: :LOL: :LOL:
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Chrysti

I've never heard of such a thing in Excel VBA.:eek:

Sounds to me that's it's more likely to be something using Windows API and/or the web.
 
Upvote 0
Chrysti

That's not too hard and if you search the board there are plenty of examples.

The 'easiest' way would be to use the SendMail method but that has various restrictions. eg you can't specify the body of the email

Other methods involve automating your email client eg Outlook, again a search will find plenty of examples.
 
Upvote 0
I have been trying to get this code to work:
Sub Mail_Small_Text_CDO()
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
' Dim Flds As Variant

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")

iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "111.111.111.111" 'Need your STMP address here
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With

strbody = "Hey There," & vbNewLine & vbNewLine & _
"Test 1" & vbNewLine & _
"Test 2" & vbNewLine & _
"Test 3" & vbNewLine & _
"Test 4"

With iMsg
Set .Configuration = iConf
.To = "Test@Test.com"
.CC = ""
.BCC = ""
.From = """TestUser"" <TestUser@test.com>"
.Subject = "Important message"
.TextBody = strbody
.Send
End With

Set iMsg = Nothing
Set iConf = Nothing
End Sub

But when I get to
.Send
I get an error

I have tried other code, but then I get an error box about if I want to continue sending, and I CAN'T install anything to get around this, is there something else that I can do to answer this box YES???
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

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