LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Out of Memory Error

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
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
Out of Memory error Jimmy D Excel Discussion (Misc queries) 0 November 25th 07 10:14 PM
Out of memory error JJ[_6_] Excel Programming 1 January 23rd 04 03:29 PM
Out of memory error. LHW[_2_] Excel Programming 4 August 27th 03 01:13 PM
Out of memory error. LHW[_2_] Excel Programming 0 August 27th 03 06:51 AM
Out of memory error. LHW[_2_] Excel Programming 0 August 27th 03 06:51 AM


All times are GMT +1. The time now is 08:09 AM.

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

About Us

"It's about Microsoft Excel"