Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Annoying "virus" alert when using code to send mail

Check out this Steve
http://www.rondebruin.nl/sendmail.htm#Prevent

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"steve" wrote in message ...
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Annoying "virus" alert when using code to send mail

Ron,

Thank you for your prompt response! You confirmed my worst fear -
having to disable the function in Outlook. Don't want to do that!

Your code specifies that the user must be connected to the internet. My
users are salesmen (on laptops) and they may or may not have internet
fired up. (I'll have to check this out to make sure.)

Tried the code in 97 & 2k and got an error on ".send"
(was on line) (Windows 2k)
Run Time Erro '-2147220960 (80040220)':
The "SendUsing" configuration value is invalid.

Both versions do not recognize "send".

Any suggestions?

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set a reference' It is not
working in Windows 98 and ME.' You must be online when you run the sub
Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is placed you must use
'Set WB = ThisWorkbook WBname = WB.Name & " " & Format(Now,
"dd-mm-yy h-mm-ss") & ".xls" WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date and Time stamp
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want with .AddAttachment "C:/Test.txt"
.Send

End With
Kill "C:/" & WBname 'If you not want to delete the file you send delete
this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub
--
sb
"Ron de Bruin" wrote in message
...
Check out this Steve
http://www.rondebruin.nl/sendmail.htm#Prevent

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"steve" wrote in message

...
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






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Annoying "virus" alert when using code to send mail

Thank you for your prompt response! You confirmed my worst fear -
having to disable the function in Outlook. Don't want to do that!


Read good this you can only do in Outlook Express
See the links for Outlook

Outlook

Outlook Redemption
http://www.dimastr.com/redemption/

Express ClickYes
http://www.express-soft.com/mailmate/clickyes.html

If you want to use CDO see the problem section for a macro to fill in the Smtp server in the code


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"steve" wrote in message ...
Ron,

Thank you for your prompt response! You confirmed my worst fear -
having to disable the function in Outlook. Don't want to do that!

Your code specifies that the user must be connected to the internet. My
users are salesmen (on laptops) and they may or may not have internet
fired up. (I'll have to check this out to make sure.)

Tried the code in 97 & 2k and got an error on ".send"
(was on line) (Windows 2k)
Run Time Erro '-2147220960 (80040220)':
The "SendUsing" configuration value is invalid.

Both versions do not recognize "send".

Any suggestions?

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set a reference' It is not
working in Windows 98 and ME.' You must be online when you run the sub
Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is placed you must use
'Set WB = ThisWorkbook WBname = WB.Name & " " & Format(Now,
"dd-mm-yy h-mm-ss") & ".xls" WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date and Time stamp
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want with .AddAttachment "C:/Test.txt"
.Send

End With
Kill "C:/" & WBname 'If you not want to delete the file you send delete
this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub
--
sb
"Ron de Bruin" wrote in message
...
Check out this Steve
http://www.rondebruin.nl/sendmail.htm#Prevent

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"steve" wrote in message

...
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








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Annoying "virus" alert when using code to send mail

Ron,

Thanks, again! But now the problem is having my users download and
install something - that won't work (unfortunately).

Guess I'll just have them click the "Yes" button...

--
sb
"Ron de Bruin" wrote in message
...
Thank you for your prompt response! You confirmed my worst fear -
having to disable the function in Outlook. Don't want to do that!


Read good this you can only do in Outlook Express
See the links for Outlook

Outlook

Outlook Redemption
http://www.dimastr.com/redemption/

Express ClickYes
http://www.express-soft.com/mailmate/clickyes.html

If you want to use CDO see the problem section for a macro to fill in the

Smtp server in the code


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"steve" wrote in message

...
Ron,

Thank you for your prompt response! You confirmed my worst fear -
having to disable the function in Outlook. Don't want to do that!

Your code specifies that the user must be connected to the internet. My
users are salesmen (on laptops) and they may or may not have internet
fired up. (I'll have to check this out to make sure.)

Tried the code in 97 & 2k and got an error on ".send"
(was on line) (Windows 2k)
Run Time Erro '-2147220960 (80040220)':
The "SendUsing" configuration value is invalid.

Both versions do not recognize "send".

Any suggestions?

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set a reference' It is

not
working in Windows 98 and ME.' You must be online when you run the sub
Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is placed you must

use
'Set WB = ThisWorkbook WBname = WB.Name & " " & Format(Now,
"dd-mm-yy h-mm-ss") & ".xls" WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date and Time stamp
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want with .AddAttachment

"C:/Test.txt"
.Send

End With
Kill "C:/" & WBname 'If you not want to delete the file you send

delete
this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub
--
sb
"Ron de Bruin" wrote in message
...
Check out this Steve
http://www.rondebruin.nl/sendmail.htm#Prevent

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"steve" wrote in message

...
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












  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Annoying "virus" alert when using code to send mail

Outlook Express is part of Internet Explorer. If they have IE 5.0 or later,
then they already have a relatively current (and stable) version of Outlook
Express.

Mike.

"steve" wrote in message
...
Ron,

Thanks, again! But now the problem is having my users download and
install something - that won't work (unfortunately).

Guess I'll just have them click the "Yes" button...

--
sb
"Ron de Bruin" wrote in message
...
Thank you for your prompt response! You confirmed my worst fear -
having to disable the function in Outlook. Don't want to do that!


Read good this you can only do in Outlook Express
See the links for Outlook

Outlook

Outlook Redemption
http://www.dimastr.com/redemption/

Express ClickYes
http://www.express-soft.com/mailmate/clickyes.html

If you want to use CDO see the problem section for a macro to fill in

the
Smtp server in the code


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"steve" wrote in message

...
Ron,

Thank you for your prompt response! You confirmed my worst fear -
having to disable the function in Outlook. Don't want to do that!

Your code specifies that the user must be connected to the internet.

My
users are salesmen (on laptops) and they may or may not have internet
fired up. (I'll have to check this out to make sure.)

Tried the code in 97 & 2k and got an error on ".send"
(was on line) (Windows 2k)
Run Time Erro '-2147220960 (80040220)':
The "SendUsing" configuration value is invalid.

Both versions do not recognize "send".

Any suggestions?

Sub CDO_Send_Workbook()
' This sub use late binding, you don't have to set a reference' It is

not
working in Windows 98 and ME.' You must be online when you run the sub
Dim iMsg As Object
Dim iConf As Object
Dim WB As Workbook
Dim WBname As String Application.ScreenUpdating = False
Set WB = ActiveWorkbook
'If you want to mail the workbook where the code is placed you

must
use
'Set WB = ThisWorkbook WBname = WB.Name & " " & Format(Now,
"dd-mm-yy h-mm-ss") & ".xls" WB.SaveCopyAs "C:/" & WBname
' It will save a copy of the file in C:/ with a Date and Time

stamp
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With iMsg
Set .Configuration = iConf
.To = "
.From = """Ron"" "
.Subject = "This is a test"
.TextBody = "Hi there"
.AddAttachment "C:/" & WBname
'.AddAttachment "C:/Test.txt"
' You can add any file you want with .AddAttachment

"C:/Test.txt"
.Send
End With
Kill "C:/" & WBname 'If you not want to delete the file you send

delete
this line
Set iMsg = Nothing
Set iConf = Nothing
Set WB = Nothing
Application.ScreenUpdating = True
End Sub
--
sb
"Ron de Bruin" wrote in message
...
Check out this Steve
http://www.rondebruin.nl/sendmail.htm#Prevent

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"steve" wrote in message
...
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












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
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 12:55 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"