mail excel to outlook problem

  • Thread starter Thread starter Dan Jordan
  • Start date Start date
D

Dan Jordan

I am trying to send an email with attachments from excel
thru outlook. when I run this code outlook locks up the
system. I think the problem is the code finishes before
outlook is finished ??? Is there a way to make the code
wait until outlook is finished before proceding????
Or is my code flawed??
Sub SendWithAtt()

Dim olApp As Outlook.Application
Dim olMail As MailItem

Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = "(e-mail address removed)"
.CC = ""
.Subject = "daily reports"
.Body = ""
.Attachments.Add "c:\abc\file1.pdf"
.Attachments.Add "c:\abc\file2.pdf"
.Display
End With

Set olMail = Nothing
Set olApp = Nothing

End Sub


Any help would be appreciated
using win2000 ,excell 2000 & outlook 2000
Dan Jordan
 
I don't have Outlook on my home pc, but we use xl2k and outlook 2k at work.

Our IT department keeps us all current on security patches.

One of the security patches stops programs from using Outlook's addressbook.

We're prompted for: Is it ok? And if yes, for how long?

Sometimes that dialog box doesn't pop up (or gets hidden by a user action???).

I'd try alt-tabbing through the open applications to see if you have a dialog
box waiting for your input.
 
Oops!!

The .display is used when i am testing - the code should
read .send


dan jordan
 
Nope,
no dialog boxes running.
This happens on 2 diffrent systems so i know its not the system. But thanks
for the reply

Dan Jordan
 
Back
Top