ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro email (https://www.excelbanter.com/excel-programming/418697-macro-email.html)

Macro not running as intended[_2_]

Macro email
 
I'm getting an error when I am using this macro:


Sub AA_CDO()
Dim iMsg As Object
Dim iConf As Object
' 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") =
"
'
..Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
' .Update
' End With
With iMsg
Set .Configuration = iConf
.To = ; "
.CC = "
.BCC = ""
.From = """Excel"" "
.Subject = "Important message"
.TextBody = "AA has reached its stop loss" & vbNewLine & vbNewLine & _
"Please review this position immediately."
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
End Sub

Any thoughts?

Ron de Bruin

Macro email
 
Have you read all information on my site ??
http://www.rondebruin.nl/cdo.htm

I see that you not use the commented lines and i see a strange name for the SMTP server


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Macro not running as intended" om wrote in message
...
I'm getting an error when I am using this macro:


Sub AA_CDO()
Dim iMsg As Object
Dim iConf As Object
' 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") =
"
'
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
' .Update
' End With
With iMsg
Set .Configuration = iConf
.To = ; "
.CC = "
.BCC = ""
.From = """Excel"" "
.Subject = "Important message"
.TextBody = "AA has reached its stop loss" & vbNewLine & vbNewLine & _
"Please review this position immediately."
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
End Sub

Any thoughts?



Macro not running as intended[_2_]

Macro email
 
That is my smtp according to outlook...I did read your site and I'm trying to
get around the constant message approval. We have outlook and I'm not sure
exactly what year of windows. I thought I understood most everything on the
site, but maybe not.

"Ron de Bruin" wrote:

Have you read all information on my site ??
http://www.rondebruin.nl/cdo.htm

I see that you not use the commented lines and i see a strange name for the SMTP server


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Macro not running as intended" om wrote in message
...
I'm getting an error when I am using this macro:


Sub AA_CDO()
Dim iMsg As Object
Dim iConf As Object
' 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") =
"
'
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
' .Update
' End With
With iMsg
Set .Configuration = iConf
.To = ; "
.CC = "
.BCC = ""
.From = """Excel"" "
.Subject = "Important message"
.TextBody = "AA has reached its stop loss" & vbNewLine & vbNewLine & _
"Please review this position immediately."
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
End Sub

Any thoughts?




Macro not running as intended[_2_]

Macro email
 
By commented lines do you mean the additional lines you have listed? Or did
I not change something I needed to?

"Ron de Bruin" wrote:

Have you read all information on my site ??
http://www.rondebruin.nl/cdo.htm

I see that you not use the commented lines and i see a strange name for the SMTP server


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Macro not running as intended" om wrote in message
...
I'm getting an error when I am using this macro:


Sub AA_CDO()
Dim iMsg As Object
Dim iConf As Object
' 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") =
"
'
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
' .Update
' End With
With iMsg
Set .Configuration = iConf
.To = ; "
.CC = "
.BCC = ""
.From = """Excel"" "
.Subject = "Important message"
.TextBody = "AA has reached its stop loss" & vbNewLine & vbNewLine & _
"Please review this position immediately."
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
End Sub

Any thoughts?





All times are GMT +1. The time now is 03:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com