Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have the following code to send files direct from excel but when I run this it comes up with the error 'Out of Memory' does any have any ideas why this is happening? Code: Sub AutoSend() Dim olApp As Outlook.Application Dim olMail As MailItem Dim cell As Range Application.ScreenUpdating = False Set olApp = New Outlook.Application For Each cell In Sheets("Sheet1").Columns ("B").Cells.SpecialCells(xlCellTypeConstants) If cell.Offset(0, 1).Value < "" Then If cell.Value Like "*@*" And Dir(cell.Offset (0, 1).Value) < "" Then Set olMail = olApp.CreateItem(olMailItem) With olMail .To = cell.Value .Subject = "Remittance Advice" .Body = "Please see the attached Remittance advice and Cover Note" .Attachments.Add cell.Offset(0, 1).Value .Attachments.Add ("c:\remit\Remittance Cover Note.doc") .Display 'Or use Display End With Set olMail = Nothing End If End If Next cell Set olApp = Nothing Application.ScreenUpdating = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Out of Memory error | Excel Discussion (Misc queries) | |||
Out of memory error | Excel Programming | |||
Out of memory error. | Excel Programming | |||
Out of memory error. | Excel Programming | |||
Out of memory error. | Excel Programming |