Dialog not displayed to the front

  • Thread starter Thread starter Leendert
  • Start date Start date
L

Leendert

Hello,

Could somebody please help me with the following problem we are
experiencing since an Office update?

When I send an document as a MailItem from Excel with VBA (with the
VBA code Send), a safety alert sometimes comes behind the Excel
window: "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"."

When this dialog is not displayed to the front, it is not possible to
respond, so after a view seconds comes another dialog box: "Microsoft
Excel is waiting for another application to complete an OLE action".

It is strange that this problem does not occur on all the computers we
use. What is the solution to get the alert always display to the
front?

We use Office 2000 and Office 2002 (Windows 2000 and Windows XP).

Here is the VBA code that I use:

Set myOlApp = CreateObject("Outlook.Application")
Set MyItem = myOlApp.CreateItem(olMailItem)
MyItem.To = ToVar
MyItem.Subject = "Afwezigheidsregistratie " & ActiveSheet.Range("A3")
Set myAttachments = MyItem.Attachments
myAttachments.Add Pad, , 1
MyItem.Send


With kind regards,

Leendert Meijer
 
Hello,

Could somebody please help me with the following problem we are
experiencing since an Office update?

When I send an document as a MailItem from Excel with VBA (with the
VBA code Send), a safety alert sometimes comes behind the Excel
window: "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"."

When this dialog is not displayed to the front, it is not possible to
respond, so after a view seconds comes another dialog box: "Microsoft
Excel is waiting for another application to complete an OLE action".

It is strange that this problem does not occur on all the computers we
use. What is the solution to get the alert always display to the
front?

We use Office 2000 and Office 2002 (Windows 2000 and Windows XP).

Here is the VBA code that I use:

Set myOlApp = CreateObject("Outlook.Application")
Set MyItem = myOlApp.CreateItem(olMailItem)
MyItem.To = ToVar
MyItem.Subject = "Afwezigheidsregistratie " & ActiveSheet.Range("A3")
Set myAttachments = MyItem.Attachments
myAttachments.Add Pad, , 1
MyItem.Send


With kind regards,

Leendert Meijer

Can nobody help me?
 
Back
Top