D
DaveH
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
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