|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hey Guys and Gals,
Trying to use VBA in a worksheet to send the report by email when it has finished running. Up to the point where the code calls for: ActiveWorkbook.SendMail Recipients:=namestring, Subject:="MyReport" I get a message asking if it is ok to email this and I need to know how to get around it as it is an automated report.... Any thoughts? Thanks |
|
#2
|
||||
|
||||
|
try adding this line before the email:
Code:
Application.DisplayAlerts = False then reset it before the end. Code:
Application.DisplayAlerts = True
__________________
Come JOIN the party!!! Quote of the Month: Retirement: Because you've given so much of yourself to the company that you don't have anything left we can use. Questions to Ponder: What do you do when you see an endangered animal eating an endangered plant? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright© 2008 sbenj69 |
|
#3
|
|||
|
|||
|
Thanks but does not work. It is a message from my outlook that is saying "a program is trying to send mail. it may contain a virus. do you want to send anyway?"
I think this is to prevent a virus from mailing itself to people in your address book. How do I get around it? |
|
#4
|
||||
|
||||
|
you could probably look at the SendKeys command. not sure if it would work, but worth a shot if Outlook opens and message box comes up in the front of the window.
Code:
Application.SendKeys "{ENTER}" 'provided the "YES" button on the confirm box is highlighted.
Last edited by mehere : June 3rd, 2008 at 01:04 PM. |
|
#5
|
||||
|
||||
|
or ... have a look at How To Prevent displaying the dialog that enables you to send or not send the message and see if it will help.
and yet another ... Sending Personalized Email from Excel Last edited by mehere : June 3rd, 2008 at 01:02 PM. |
|
#6
|
||||
|
||||
|
Great post, mehere!
You could also send the email using CDO and avoid using Outlook altogether.
__________________
Click the image if at any point you don't like my decision.Scripting problems? Windows questions? Ask the Windows Guru! |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > Using VBA in Excell to send email |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|