Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am using the macro below to send an e-mail from excel (through outlook). When there is no attachment to the e-mail (take that command out) it works fine. However, when you try and attach a file it comes up it comes up with Run-time error 438. Object doesn't support this property or method. Here is the macro - I would be grateful for any assistance. Sub Mail_workbook_Outlook() Dim OutApp As Object Dim OutMail As Object Dim cell As Range Dim strto As String For Each cell In ThisWorkbook.Sheets("E-mail Contacts") _ .Columns("i").Cells.SpecialCells(xlCellTypeConstan ts) If cell.Value Like "*@*" Then strto = strto & cell.Value & ";" End If Next strto = Left(strto, Len(strto) - 1) Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) With OutMail .To = "" .CC = "" .BCC = strto .Subject = "" .Body = "" .Attachment.Add ("") .Send 'or use .Display End With Set OutMail = Nothing Set OutApp = Nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
naming tab macro error runtime error 1004 | Excel Programming | |||
Macro 'Automation error' with ChemOffice Excel macro | Excel Programming |