LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Annoying "virus" alert when using code to send mail

I am getting an alert when using the below code to send mail from Excel.
How do I prevent this alert?

Thanks for your help...

The alert reads:
A program is trying to automatically send e-mail on your behalf.
Do you want to Allow this.
If this is unexpected, it may be a virus and you should choose "No".

Sub SendMyMail()
Dim subj As String
Application.DisplayAlerts = False

If MsgBox("Ready to send?", vbYesNo + vbQuestion) = vbYes Then
subj = Sheets(2).Cells(7, 3) & " Quote "
subj = subj & InputBox("Add to your Subject Line", "email Subject")
subj = WorksheetFunction.Proper(subj)

'Emails the activeworkbook'
ActiveWorkbook.SendMail ", _
Subject:=subj, ReturnReceipt:=True
End If

Application.DisplayAlerts = True
End Sub


--
sb


 
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
Excel 2003 giving annoying "Send/Don't Send" error when closing BigDaddyCool Excel Discussion (Misc queries) 0 January 29th 10 02:31 AM
Excel hangs after using "Send to mail recipient (as attachment) " Rob Excel Discussion (Misc queries) 1 November 11th 09 10:16 PM
Using 2007 Office EXCEL or WORD "SEND" Results in General Mail Fai Jerry Link Excel Discussion (Misc queries) 1 December 29th 08 04:54 PM
Signature missing when "send to" "mail recipient" Jim Tortorelli Excel Discussion (Misc queries) 2 September 21st 07 05:19 PM
How to hide "Send To Mail Recipient" data? REMB Excel Discussion (Misc queries) 1 August 6th 07 09:10 PM


All times are GMT +1. The time now is 11:13 AM.

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"