Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Special Action on E-Mail Error Condition

Hi:

I am setting up to E-mail something from excel through Outlook.

The code of interest is:
(messname is the name of the message)

ActiveWorkbook.SendMail ", "), _
messname

The problem is that Outlook pops up a warning message that someone is trying to e-mail,
and asks for approval. If the user approves, thats fine but if they click NO the system
goes off into never never land.

I want to be able to detect that they have clicked no and take specific action to close
some files and tidy things up. My question is how do I do that?

Advice appreciated

John Baker
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Special Action on E-Mail Error Condition

Try this

On Error Resume Next
ActiveWorkbook.SendMail ", "), _
messnamer
If Err.Number 0 Then
'your code
End If
On Error GoTo 0




--
Regards Ron de Bruin
http://www.rondebruin.nl


"John Baker" wrote in message ...
Hi:

I am setting up to E-mail something from excel through Outlook.

The code of interest is:
(messname is the name of the message)

ActiveWorkbook.SendMail ", "), _
messname

The problem is that Outlook pops up a warning message that someone is trying to e-mail,
and asks for approval. If the user approves, thats fine but if they click NO the system
goes off into never never land.

I want to be able to detect that they have clicked no and take specific action to close
some files and tidy things up. My question is how do I do that?

Advice appreciated

John Baker



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Special Action on E-Mail Error Condition

Uuse the Err.Clear also

On Error Resume Next
ActiveWorkbook.SendMail ", "), _
messnamer
If Err.Number 0 Then
'your code
Err.Clear
End If
On Error GoTo 0


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ron de Bruin" wrote in message ...
Try this

On Error Resume Next
ActiveWorkbook.SendMail ", "), _
messnamer
If Err.Number 0 Then
'your code
End If
On Error GoTo 0




--
Regards Ron de Bruin
http://www.rondebruin.nl


"John Baker" wrote in message ...
Hi:

I am setting up to E-mail something from excel through Outlook.

The code of interest is:
(messname is the name of the message)

ActiveWorkbook.SendMail ", "), _
messname

The problem is that Outlook pops up a warning message that someone is trying to e-mail,
and asks for approval. If the user approves, thats fine but if they click NO the system
goes off into never never land.

I want to be able to detect that they have clicked no and take specific action to close
some files and tidy things up. My question is how do I do that?

Advice appreciated

John Baker





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Special Action on E-Mail Error Condition

Thanks a lot.

Now an even more complicated question..is there some way that i can suppress the outlook
message in its entirety?

This would be particularly desirable since I am , under some circumstances, sending two
messages at the same time to different recipients -- and this means two calls.

Thanks

John

John Baker wrote:

Hi:

I am setting up to E-mail something from excel through Outlook.

The code of interest is:
(messname is the name of the message)

ActiveWorkbook.SendMail ", "), _
messname

The problem is that Outlook pops up a warning message that someone is trying to e-mail,
and asks for approval. If the user approves, thats fine but if they click NO the system
goes off into never never land.

I want to be able to detect that they have clicked no and take specific action to close
some files and tidy things up. My question is how do I do that?

Advice appreciated

John Baker


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Special Action on E-Mail Error Condition

Hi John

Look here
http://www.rondebruin.nl/sendmail.htm#Prevent



--
Regards Ron de Bruin
http://www.rondebruin.nl


"John Baker" wrote in message ...
Thanks a lot.

Now an even more complicated question..is there some way that i can suppress the outlook
message in its entirety?

This would be particularly desirable since I am , under some circumstances, sending two
messages at the same time to different recipients -- and this means two calls.

Thanks

John

John Baker wrote:

Hi:

I am setting up to E-mail something from excel through Outlook.

The code of interest is:
(messname is the name of the message)

ActiveWorkbook.SendMail ", "), _
messname

The problem is that Outlook pops up a warning message that someone is trying to e-mail,
and asks for approval. If the user approves, thats fine but if they click NO the system
goes off into never never land.

I want to be able to detect that they have clicked no and take specific action to close
some files and tidy things up. My question is how do I do that?

Advice appreciated

John Baker






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Special Action on E-Mail Error Condition

Ron:

Thanks. I guess you can only avoid it by changing settings in Outlook. I dont think my
clients would be willing to do that, so maybe I shall have to change my approach.
Showwarnings=False wont do It i guess.

Thanks

john


"Ron de Bruin" wrote:

Hi John

Look here
http://www.rondebruin.nl/sendmail.htm#Prevent


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Special Action on E-Mail Error Condition

I guess you can only avoid it by changing settings in Outlook
In Outlook you can't do this, only in Outlook Express

Try the program Click Yes or use CDO(see the link on my site)


--
Regards Ron de Bruin
http://www.rondebruin.nl


"John Baker" wrote in message ...
Ron:

Thanks. I guess you can only avoid it by changing settings in Outlook. I dont think my
clients would be willing to do that, so maybe I shall have to change my approach.
Showwarnings=False wont do It i guess.

Thanks

john


"Ron de Bruin" wrote:

Hi John

Look here
http://www.rondebruin.nl/sendmail.htm#Prevent




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
Error: cannot load the mail service. Check your mail installation. Brad Bowser Excel Discussion (Misc queries) 0 December 20th 05 10:03 PM
Action on Error No Name Excel Programming 2 February 27th 04 06:57 PM
Action on error Mike Excel Programming 2 February 27th 04 06:08 PM
Sending an Outlook e-mail due to a condition in a cell.. vee[_2_] Excel Programming 3 September 12th 03 09:04 AM
Sending an Outlook e-mail due to a condition in a cell Ron de Bruin Excel Programming 0 August 11th 03 06:01 PM


All times are GMT +1. The time now is 12:46 PM.

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

About Us

"It's about Microsoft Excel"