Avoid security pop-up when sending Excel attachment in Outlook

helgeroe

New Member
Joined
Dec 16, 2008
Messages
37
Hi
I'm tying to send a Excel generated mail with attachment from Outlook, but get this security message:

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

Excerpts from the code I'm using:

Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
oNameSpace.Logon , , True

Set oMailItem = oOutlook.CreateItem(0)
With oMailItem
.To = Email
.Subject = emne
.body = tekst
.Attachments.Add ActiveWorkbook.FullName
.Importance = olImportanceHigh
' .Display
.send
End With

How do I avoid this pop-up?

Would also be practical to mark the e-mail with High Importance (tried in the code, but did not work) and to flag the mail to be followed up within a date.

Using Office 2003.

Thanks. :)

Helge
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Thanks, but did not get this to work.

Tried to use this code, but no mail is created:

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")

With iMsg
Set .Configuration = iConf
.To = Email
.Subject = emne
.TextBody = tekst
.AddAttachment ThisWorkbook.Path & "\" & sti & "\" & FilNavn & ".xls"
.Send
End With


What do I do wrong?

Also do you know how to put High Importance in a message and/or flag it?
 
Upvote 0
i have just solved this problem myself...
but i didnt use CDO.

security can be blocked using 'advanced security' by mapilab (google)

its free

i have no connection with this software developer.
 
Upvote 0
i have just solved this problem myself...
but i didnt use CDO.

security can be blocked using 'advanced security' by mapilab (google)

its free

i have no connection with this software developer.

Thanks, but the code will be used by several different people in the organization and will be difficult to implement due to the strickt installation policy we have here. :(
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top