Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default Excel file sending an e-mail, is possible?

Is it possible excel send out an e-mail when certain
conditions are met?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Excel file sending an e-mail, is possible?

Hi Mukesh

http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message ...
Is it possible excel send out an e-mail when certain
conditions are met?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default Excel file sending an e-mail, is possible?

Thank you Rob....I will test it out and post back if
I encounter any problems.

Thanks.
Mukesh


"Ron de Bruin" wrote:

Hi Mukesh

http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message ...
Is it possible excel send out an e-mail when certain
conditions are met?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default Excel file sending an e-mail, is possible?


Rob,
I am using example 1 from your site....and while running the
macro, I get an error "Can't execute code in break mode",
sorry don't understand, how do I fix it.

Thanks.
Mukesh




"Mukesh" wrote:

Thank you Rob....I will test it out and post back if
I encounter any problems.

Thanks.
Mukesh


"Ron de Bruin" wrote:

Hi Mukesh

http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message ...
Is it possible excel send out an e-mail when certain
conditions are met?


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Excel file sending an e-mail, is possible?

Click on the reset button in the VBA editor and be sure that you change the macro name in the change event



--

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


"Mukesh" wrote in message ...

Rob,
I am using example 1 from your site....and while running the
macro, I get an error "Can't execute code in break mode",
sorry don't understand, how do I fix it.

Thanks.
Mukesh




"Mukesh" wrote:

Thank you Rob....I will test it out and post back if
I encounter any problems.

Thanks.
Mukesh


"Ron de Bruin" wrote:

Hi Mukesh

http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message ...
Is it possible excel send out an e-mail when certain
conditions are met?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default Excel file sending an e-mail, is possible?

Rob,

Now I am getting an error " The "SendUsing" configuration value
is invalid ". .....can fix?

Thanks.
Mukesh




"Ron de Bruin" wrote:

Click on the reset button in the VBA editor and be sure that you change the macro name in the change event



--

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


"Mukesh" wrote in message ...

Rob,
I am using example 1 from your site....and while running the
macro, I get an error "Can't execute code in break mode",
sorry don't understand, how do I fix it.

Thanks.
Mukesh




"Mukesh" wrote:

Thank you Rob....I will test it out and post back if
I encounter any problems.

Thanks.
Mukesh


"Ron de Bruin" wrote:

Hi Mukesh

http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message ...
Is it possible excel send out an e-mail when certain
conditions are met?


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Excel file sending an e-mail, is possible?

Please read the information on the CDO page if you want to use this macro

--

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


"Mukesh" wrote in message ...
Rob,

Now I am getting an error " The "SendUsing" configuration value
is invalid ". .....can fix?

Thanks.
Mukesh




"Ron de Bruin" wrote:

Click on the reset button in the VBA editor and be sure that you change the macro name in the change event



--

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


"Mukesh" wrote in message ...

Rob,
I am using example 1 from your site....and while running the
macro, I get an error "Can't execute code in break mode",
sorry don't understand, how do I fix it.

Thanks.
Mukesh




"Mukesh" wrote:

Thank you Rob....I will test it out and post back if
I encounter any problems.

Thanks.
Mukesh


"Ron de Bruin" wrote:

Hi Mukesh

http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message ...
Is it possible excel send out an e-mail when certain
conditions are met?


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default Excel file sending an e-mail, is possible?


Hi Rob,

It took me nearly 3 hours, and finally figured out what wrong I was
doing....its
working now. Thanks a lot.
On to my project.

Thanks.
Mukesh




"Ron de Bruin" wrote:

Please read the information on the CDO page if you want to use this macro

--

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


"Mukesh" wrote in message ...
Rob,

Now I am getting an error " The "SendUsing" configuration value
is invalid ". .....can fix?

Thanks.
Mukesh




"Ron de Bruin" wrote:

Click on the reset button in the VBA editor and be sure that you change the macro name in the change event



--

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


"Mukesh" wrote in message ...

Rob,
I am using example 1 from your site....and while running the
macro, I get an error "Can't execute code in break mode",
sorry don't understand, how do I fix it.

Thanks.
Mukesh




"Mukesh" wrote:

Thank you Rob....I will test it out and post back if
I encounter any problems.

Thanks.
Mukesh


"Ron de Bruin" wrote:

Hi Mukesh

http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message ...
Is it possible excel send out an e-mail when certain
conditions are met?



  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 102
Default Excel file sending an e-mail, is possible?

Hi Mukesh

I too have had the problems you are having and although have read the info
Ron advised am still none the wiser as to what I am doing wrong - how did you
sort this out please?
--
Thanks

Lise (Aussie)


"Mukesh" wrote:


Hi Rob,

It took me nearly 3 hours, and finally figured out what wrong I was
doing....its
working now. Thanks a lot.
On to my project.

Thanks.
Mukesh




"Ron de Bruin" wrote:

Please read the information on the CDO page if you want to use this macro

--

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


"Mukesh" wrote in message ...
Rob,

Now I am getting an error " The "SendUsing" configuration value
is invalid ". .....can fix?

Thanks.
Mukesh




"Ron de Bruin" wrote:

Click on the reset button in the VBA editor and be sure that you change the macro name in the change event



--

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


"Mukesh" wrote in message ...

Rob,
I am using example 1 from your site....and while running the
macro, I get an error "Can't execute code in break mode",
sorry don't understand, how do I fix it.

Thanks.
Mukesh




"Mukesh" wrote:

Thank you Rob....I will test it out and post back if
I encounter any problems.

Thanks.
Mukesh


"Ron de Bruin" wrote:

Hi Mukesh

http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message ...
Is it possible excel send out an e-mail when certain
conditions are met?



  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default Excel file sending an e-mail, is possible?

Hi Lise,

I just saw your request, hope you have sorted out, if not hereunder is the
code that
works well, the only problem is that I have to run the macro to send e-mail,
whereas
I want e-mail to be sent out automatically once the cell values have changed.
Haven't had time to sort that out, but if you or anyone knows, please advise.

Copy/paste to vb, change e-mail settings/password which I am sure you
know or can find in outlook.


Sub Mail_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") =
"smtp.domain.com"

..Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

..Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

..Item("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"LoginID"

..Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"123456"

.Update
End With
With iMsg
Set .Configuration = iConf
.To = "
.CC = ""
.BCC = ""
.From = """Sender's Name"" "
.Subject = "Your Subject goes here - This is Subject Line"
.TextBody = "This is the main body" & vbNewLine & vbNewLine & _
"Message goes here - Cell A1 value has changed"
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
End Sub


Thanks.
Mukesh




"Lise" wrote:

Hi Mukesh

I too have had the problems you are having and although have read the info
Ron advised am still none the wiser as to what I am doing wrong - how did you
sort this out please?
--
Thanks

Lise (Aussie)


"Mukesh" wrote:


Hi Rob,

It took me nearly 3 hours, and finally figured out what wrong I was
doing....its
working now. Thanks a lot.
On to my project.

Thanks.
Mukesh




"Ron de Bruin" wrote:

Please read the information on the CDO page if you want to use this macro

--

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


"Mukesh" wrote in message ...
Rob,

Now I am getting an error " The "SendUsing" configuration value
is invalid ". .....can fix?

Thanks.
Mukesh




"Ron de Bruin" wrote:

Click on the reset button in the VBA editor and be sure that you change the macro name in the change event



--

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


"Mukesh" wrote in message ...

Rob,
I am using example 1 from your site....and while running the
macro, I get an error "Can't execute code in break mode",
sorry don't understand, how do I fix it.

Thanks.
Mukesh




"Mukesh" wrote:

Thank you Rob....I will test it out and post back if
I encounter any problems.

Thanks.
Mukesh


"Ron de Bruin" wrote:

Hi Mukesh

http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message ...
Is it possible excel send out an e-mail when certain
conditions are met?





  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Excel file sending an e-mail, is possible?

See
http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message ...
Hi Lise,

I just saw your request, hope you have sorted out, if not hereunder is the
code that
works well, the only problem is that I have to run the macro to send e-mail,
whereas
I want e-mail to be sent out automatically once the cell values have changed.
Haven't had time to sort that out, but if you or anyone knows, please advise.

Copy/paste to vb, change e-mail settings/password which I am sure you
know or can find in outlook.


Sub Mail_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") =
"smtp.domain.com"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"LoginID"

.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"123456"

.Update
End With
With iMsg
Set .Configuration = iConf
.To = "
.CC = ""
.BCC = ""
.From = """Sender's Name"" "
.Subject = "Your Subject goes here - This is Subject Line"
.TextBody = "This is the main body" & vbNewLine & vbNewLine & _
"Message goes here - Cell A1 value has changed"
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
End Sub


Thanks.
Mukesh




"Lise" wrote:

Hi Mukesh

I too have had the problems you are having and although have read the info
Ron advised am still none the wiser as to what I am doing wrong - how did you
sort this out please?
--
Thanks

Lise (Aussie)


"Mukesh" wrote:


Hi Rob,

It took me nearly 3 hours, and finally figured out what wrong I was
doing....its
working now. Thanks a lot.
On to my project.

Thanks.
Mukesh




"Ron de Bruin" wrote:

Please read the information on the CDO page if you want to use this macro

--

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


"Mukesh" wrote in message ...
Rob,

Now I am getting an error " The "SendUsing" configuration value
is invalid ". .....can fix?

Thanks.
Mukesh




"Ron de Bruin" wrote:

Click on the reset button in the VBA editor and be sure that you change the macro name in the change event



--

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


"Mukesh" wrote in message ...

Rob,
I am using example 1 from your site....and while running the
macro, I get an error "Can't execute code in break mode",
sorry don't understand, how do I fix it.

Thanks.
Mukesh




"Mukesh" wrote:

Thank you Rob....I will test it out and post back if
I encounter any problems.

Thanks.
Mukesh


"Ron de Bruin" wrote:

Hi Mukesh

http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message
...
Is it possible excel send out an e-mail when certain
conditions are met?




  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default Excel file sending an e-mail, is possible?

Thank you Ron.

I have following code in module 2, what could be wrong as it
doesn't work.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Target.Cells.Count 1 Then Exit Sub
On Error GoTo EndMacro
If Not Target.HasFormula Then
Set rng = Target.Dependents
If Not Intersect(Range("A6"), rng) Is Nothing Then
If Range("A6").Value < 100 Then Mail_CDO
End If
End If
EndMacro:
End Sub

Is it possible to have a pop up message to say that the e-mail is
sent/being sent or is not sent due to an error or something like that.

Thanks.
Mukesh



"Ron de Bruin" wrote:

See
http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message ...
Hi Lise,

I just saw your request, hope you have sorted out, if not hereunder is the
code that
works well, the only problem is that I have to run the macro to send e-mail,
whereas
I want e-mail to be sent out automatically once the cell values have changed.
Haven't had time to sort that out, but if you or anyone knows, please advise.

Copy/paste to vb, change e-mail settings/password which I am sure you
know or can find in outlook.


Sub Mail_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") =
"smtp.domain.com"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"LoginID"

.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"123456"

.Update
End With
With iMsg
Set .Configuration = iConf
.To = "
.CC = ""
.BCC = ""
.From = """Sender's Name"" "
.Subject = "Your Subject goes here - This is Subject Line"
.TextBody = "This is the main body" & vbNewLine & vbNewLine & _
"Message goes here - Cell A1 value has changed"
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
End Sub


Thanks.
Mukesh




"Lise" wrote:

Hi Mukesh

I too have had the problems you are having and although have read the info
Ron advised am still none the wiser as to what I am doing wrong - how did you
sort this out please?
--
Thanks

Lise (Aussie)


"Mukesh" wrote:


Hi Rob,

It took me nearly 3 hours, and finally figured out what wrong I was
doing....its
working now. Thanks a lot.
On to my project.

Thanks.
Mukesh




"Ron de Bruin" wrote:

Please read the information on the CDO page if you want to use this macro

--

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


"Mukesh" wrote in message ...
Rob,

Now I am getting an error " The "SendUsing" configuration value
is invalid ". .....can fix?

Thanks.
Mukesh




"Ron de Bruin" wrote:

Click on the reset button in the VBA editor and be sure that you change the macro name in the change event



--

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


"Mukesh" wrote in message ...

Rob,
I am using example 1 from your site....and while running the
macro, I get an error "Can't execute code in break mode",
sorry don't understand, how do I fix it.

Thanks.
Mukesh




"Mukesh" wrote:

Thank you Rob....I will test it out and post back if
I encounter any problems.

Thanks.
Mukesh


"Ron de Bruin" wrote:

Hi Mukesh

http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message
...
Is it possible excel send out an e-mail when certain
conditions are met?





  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Excel file sending an e-mail, is possible?

Read good, not in a normal module

1) Right click on a sheet tab and choose view code
2) Paste one of the events in this module.
3) Alt-Q to go back to Excel



--

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


"Mukesh" wrote in message ...
Thank you Ron.

I have following code in module 2, what could be wrong as it
doesn't work.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Target.Cells.Count 1 Then Exit Sub
On Error GoTo EndMacro
If Not Target.HasFormula Then
Set rng = Target.Dependents
If Not Intersect(Range("A6"), rng) Is Nothing Then
If Range("A6").Value < 100 Then Mail_CDO
End If
End If
EndMacro:
End Sub

Is it possible to have a pop up message to say that the e-mail is
sent/being sent or is not sent due to an error or something like that.

Thanks.
Mukesh



"Ron de Bruin" wrote:

See
http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message ...
Hi Lise,

I just saw your request, hope you have sorted out, if not hereunder is the
code that
works well, the only problem is that I have to run the macro to send e-mail,
whereas
I want e-mail to be sent out automatically once the cell values have changed.
Haven't had time to sort that out, but if you or anyone knows, please advise.

Copy/paste to vb, change e-mail settings/password which I am sure you
know or can find in outlook.


Sub Mail_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") =
"smtp.domain.com"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"LoginID"

.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"123456"

.Update
End With
With iMsg
Set .Configuration = iConf
.To = "
.CC = ""
.BCC = ""
.From = """Sender's Name"" "
.Subject = "Your Subject goes here - This is Subject Line"
.TextBody = "This is the main body" & vbNewLine & vbNewLine & _
"Message goes here - Cell A1 value has changed"
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
End Sub


Thanks.
Mukesh




"Lise" wrote:

Hi Mukesh

I too have had the problems you are having and although have read the info
Ron advised am still none the wiser as to what I am doing wrong - how did you
sort this out please?
--
Thanks

Lise (Aussie)


"Mukesh" wrote:


Hi Rob,

It took me nearly 3 hours, and finally figured out what wrong I was
doing....its
working now. Thanks a lot.
On to my project.

Thanks.
Mukesh




"Ron de Bruin" wrote:

Please read the information on the CDO page if you want to use this macro

--

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


"Mukesh" wrote in message ...
Rob,

Now I am getting an error " The "SendUsing" configuration value
is invalid ". .....can fix?

Thanks.
Mukesh




"Ron de Bruin" wrote:

Click on the reset button in the VBA editor and be sure that you change the macro name in the change event



--

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


"Mukesh" wrote in message ...

Rob,
I am using example 1 from your site....and while running the
macro, I get an error "Can't execute code in break mode",
sorry don't understand, how do I fix it.

Thanks.
Mukesh




"Mukesh" wrote:

Thank you Rob....I will test it out and post back if
I encounter any problems.

Thanks.
Mukesh


"Ron de Bruin" wrote:

Hi Mukesh

http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message
...
Is it possible excel send out an e-mail when certain
conditions are met?






  #14   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default Excel file sending an e-mail, is possible?

It worked.

Thank you very much.

Rgds,
Mukesh



"Ron de Bruin" wrote:

Read good, not in a normal module

1) Right click on a sheet tab and choose view code
2) Paste one of the events in this module.
3) Alt-Q to go back to Excel



--

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


"Mukesh" wrote in message ...
Thank you Ron.

I have following code in module 2, what could be wrong as it
doesn't work.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Target.Cells.Count 1 Then Exit Sub
On Error GoTo EndMacro
If Not Target.HasFormula Then
Set rng = Target.Dependents
If Not Intersect(Range("A6"), rng) Is Nothing Then
If Range("A6").Value < 100 Then Mail_CDO
End If
End If
EndMacro:
End Sub

Is it possible to have a pop up message to say that the e-mail is
sent/being sent or is not sent due to an error or something like that.

Thanks.
Mukesh



"Ron de Bruin" wrote:

See
http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message ...
Hi Lise,

I just saw your request, hope you have sorted out, if not hereunder is the
code that
works well, the only problem is that I have to run the macro to send e-mail,
whereas
I want e-mail to be sent out automatically once the cell values have changed.
Haven't had time to sort that out, but if you or anyone knows, please advise.

Copy/paste to vb, change e-mail settings/password which I am sure you
know or can find in outlook.


Sub Mail_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") =
"smtp.domain.com"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"LoginID"

.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"123456"

.Update
End With
With iMsg
Set .Configuration = iConf
.To = "
.CC = ""
.BCC = ""
.From = """Sender's Name"" "
.Subject = "Your Subject goes here - This is Subject Line"
.TextBody = "This is the main body" & vbNewLine & vbNewLine & _
"Message goes here - Cell A1 value has changed"
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
End Sub


Thanks.
Mukesh




"Lise" wrote:

Hi Mukesh

I too have had the problems you are having and although have read the info
Ron advised am still none the wiser as to what I am doing wrong - how did you
sort this out please?
--
Thanks

Lise (Aussie)


"Mukesh" wrote:


Hi Rob,

It took me nearly 3 hours, and finally figured out what wrong I was
doing....its
working now. Thanks a lot.
On to my project.

Thanks.
Mukesh




"Ron de Bruin" wrote:

Please read the information on the CDO page if you want to use this macro

--

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


"Mukesh" wrote in message ...
Rob,

Now I am getting an error " The "SendUsing" configuration value
is invalid ". .....can fix?

Thanks.
Mukesh




"Ron de Bruin" wrote:

Click on the reset button in the VBA editor and be sure that you change the macro name in the change event



--

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


"Mukesh" wrote in message ...

Rob,
I am using example 1 from your site....and while running the
macro, I get an error "Can't execute code in break mode",
sorry don't understand, how do I fix it.

Thanks.
Mukesh




"Mukesh" wrote:

Thank you Rob....I will test it out and post back if
I encounter any problems.

Thanks.
Mukesh


"Ron de Bruin" wrote:

Hi Mukesh

http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message
...
Is it possible excel send out an e-mail when certain
conditions are met?







  #15   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default Excel file sending an e-mail, is possible?

Ron,

I have streaming prices in excel and I have set to receive an
e-mail when a certain value on a particular cell is reached,
unfortunately it doesn't work (its a formula cell (adds few cells),
I am using the 2nd option from your site).

However, when I manually input numbers and set to receive an e-mail,
it works!! what could be wrong, is it because of live prices?
is there a way to fix.

Thanks.
Mukesh




"Mukesh" wrote:

It worked.

Thank you very much.

Rgds,
Mukesh



"Ron de Bruin" wrote:

Read good, not in a normal module

1) Right click on a sheet tab and choose view code
2) Paste one of the events in this module.
3) Alt-Q to go back to Excel



--

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


"Mukesh" wrote in message ...
Thank you Ron.

I have following code in module 2, what could be wrong as it
doesn't work.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Target.Cells.Count 1 Then Exit Sub
On Error GoTo EndMacro
If Not Target.HasFormula Then
Set rng = Target.Dependents
If Not Intersect(Range("A6"), rng) Is Nothing Then
If Range("A6").Value < 100 Then Mail_CDO
End If
End If
EndMacro:
End Sub

Is it possible to have a pop up message to say that the e-mail is
sent/being sent or is not sent due to an error or something like that.

Thanks.
Mukesh



"Ron de Bruin" wrote:

See
http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message ...
Hi Lise,

I just saw your request, hope you have sorted out, if not hereunder is the
code that
works well, the only problem is that I have to run the macro to send e-mail,
whereas
I want e-mail to be sent out automatically once the cell values have changed.
Haven't had time to sort that out, but if you or anyone knows, please advise.

Copy/paste to vb, change e-mail settings/password which I am sure you
know or can find in outlook.


Sub Mail_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") =
"smtp.domain.com"

.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"LoginID"

.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"123456"

.Update
End With
With iMsg
Set .Configuration = iConf
.To = "
.CC = ""
.BCC = ""
.From = """Sender's Name"" "
.Subject = "Your Subject goes here - This is Subject Line"
.TextBody = "This is the main body" & vbNewLine & vbNewLine & _
"Message goes here - Cell A1 value has changed"
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
End Sub


Thanks.
Mukesh




"Lise" wrote:

Hi Mukesh

I too have had the problems you are having and although have read the info
Ron advised am still none the wiser as to what I am doing wrong - how did you
sort this out please?
--
Thanks

Lise (Aussie)


"Mukesh" wrote:


Hi Rob,

It took me nearly 3 hours, and finally figured out what wrong I was
doing....its
working now. Thanks a lot.
On to my project.

Thanks.
Mukesh




"Ron de Bruin" wrote:

Please read the information on the CDO page if you want to use this macro

--

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


"Mukesh" wrote in message ...
Rob,

Now I am getting an error " The "SendUsing" configuration value
is invalid ". .....can fix?

Thanks.
Mukesh




"Ron de Bruin" wrote:

Click on the reset button in the VBA editor and be sure that you change the macro name in the change event



--

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


"Mukesh" wrote in message ...

Rob,
I am using example 1 from your site....and while running the
macro, I get an error "Can't execute code in break mode",
sorry don't understand, how do I fix it.

Thanks.
Mukesh




"Mukesh" wrote:

Thank you Rob....I will test it out and post back if
I encounter any problems.

Thanks.
Mukesh


"Ron de Bruin" wrote:

Hi Mukesh

http://www.rondebruin.nl/mail/change.htm

--

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


"Mukesh" wrote in message
...
Is it possible excel send out an e-mail when certain
conditions are met?







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sending an excel attachment in an e-mail drumane Excel Discussion (Misc queries) 2 April 21st 08 04:14 PM
sending mails from excel...but mail body disappearing Jithu Excel Discussion (Misc queries) 1 January 10th 08 01:03 PM
Sending One Cell Through Mail from Excel Man Mohan Singh Excel Worksheet Functions 1 April 27th 07 10:56 AM
Sending an e-mail from the Excel or Word toolbar Andy Excel Discussion (Misc queries) 2 December 26th 06 04:38 PM
General mail failure when sending e-mail from Excel Adrienne Excel Discussion (Misc queries) 5 November 4th 05 12:59 PM


All times are GMT +1. The time now is 01:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"