Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default mail excel to outlook problem


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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default mail excel to outlook problem

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.




Dan Jordan wrote:

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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default mail excel to outlook problem



Oops!!

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


dan jordan




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default mail excel to outlook problem

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




Dan Jordan wrote:

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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


--

Dave Peterson



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default mail excel to outlook problem


Update to my problem

The code works 1 time.I can run it and it will work fine
the 1st time but if I run it again outlook locks up.
If I reboot the computer it will work again but only 1
time then locks up again. anyone know why it does this or
is there a way to fix it?



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
E-Mail attachment to same e-mail address in Outlook Vick Excel Discussion (Misc queries) 4 May 17th 07 07:53 PM
e-mail from excel when outlook is not in use Jignesh Khandwala Excel Discussion (Misc queries) 5 April 7th 06 09:52 AM
Excel/Outlook Mail Merge??? WhoaNelly Excel Discussion (Misc queries) 3 April 26th 05 04:24 PM
Display mail application either in Outlook, or Outlook express [email protected] Excel Programming 0 April 13th 04 09:50 PM
e-mail from Excel - Outlook warning msg box problem patterson_m[_2_] Excel Programming 4 October 13th 03 03:31 AM


All times are GMT +1. The time now is 04:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"