Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default send email macro with Outlook running

I have a small macro that runs in Excel that will attach a file and emails
the attachment. Runs fine when Outlook is not running, but I have problems
when Outlook is already running. (runtime error ) and excel complains as
well.
Code looks like this:
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
Set NSpace = OutlookApp.GetNamespace("MAPI")
OutlookMail.To = MailArchiveAddress 'EmailID
OutlookMail.Subject = " File Upload from: " & Name
OutlookMail.Body = "Calibration UpLoad File"
OutlookMail.Attachments.Add MailAttach ' attachment filename
OutlookMail.Display
set OutlookMail = Nothing
set OutlookApp = Nothing
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
Send a Sheet as body of Outlook Email David Ackerman on cape cod Excel Discussion (Misc queries) 0 March 19th 10 03:11 PM
Send Range to Outlook and Email it markb Excel Programming 0 October 15th 07 06:05 PM
How to send a single page email from excel 2000 using outlook xp vols2812 Excel Worksheet Functions 1 December 30th 06 06:45 PM
***** PLEASE HELP **** Send an email from Excel to outlook with an automatic macro SAM SEBAIHI Excel Discussion (Misc queries) 0 November 11th 06 08:17 AM
How do use outlook express to send email in office 2003 How do use outlook express to send email Excel Discussion (Misc queries) 1 July 19th 05 12:35 PM


All times are GMT +1. The time now is 08:09 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"