PC Review

Thread Tools Rate Thread

Outlook Error 'The operation cannot be performed because the object has been deleted.'

Posts: n/a
      27th Feb 2006
Hi all,

I am sending a mail through Excel, we now have Office 2003. On Office
2k it was still working for ages. I am having the mail in a VBA class.
The part below throws the error 'The operation cannot be performed
because the object has been deleted.' when i show the MailItem before
sending AND having an file attached. If i am sending the mail with or
without attachment straight without displaying first, it works perfekt.
Has anybody an idea?

Intersting, if i remove and add the attachment again when displaying
the mail, it works. The problem causes the attachment. (The file
attached file is small, just a single s/s with one page and a few
lines.) Ihave no clue how i can make it run again with displaying the
msg first.

Thx and Cheers

'Simpyfied sending procedure in clsMail
Public Sub SendMail()

Dim objOutlook As Outlook.Application
Dim objMailItem As Outlook.MailItem
Dim objRecipient As Object

Dim i As Integer
Dim iCountWrongRecipients As Integer

On Error GoTo Err_MailTo_Immediat

Set objOutlook = Outlook.Application
Set objMailItem = objOutlook.CreateItem(olMailItem)
With objMailItem
'Check if they exist, if not, underline them red
If IsArray(MailTo) Then
For i = LBound(vaMailTo) To UBound(MailTo)
Set objRecipient =
objRecipient.Type = 1 'olTo
If Not objRecipient.Resolve Then
iCountWrongRecipients = iCountWrongRecipients + 1
End If
End If

'If optional variable has a attachement
If Not IsEmpty(Attachements) And IsArray(Attachements) Then
For i = LBound(Attachements) To UBound(Attachements)
.Attachments.Add Attachements(i)
End If

.Subject = Header
.BodyFormat = 1 'olFormatPlain
.Body = Message

.Importance = Importance 'bytImportance 'olImportanceHigh = 2
'show message on screen for checking/adding/correcting
If iCountWrongRecipients > 0 Then
MsgBox iCountWrongRecipients & " recipeints could not be
resolved!", vbExclamation
bDisplay = True 'Errors, so display anyway
End If
'Display msg b4 send
If bDisplay And iCountWrongRecipients > 0 Then
Call LogData(iCountWrongRecipients & " recipeints could not
be resolved!")
ElseIf bDisplay Then
End If
End With
Set objOutlook = Nothing
Set objMailItem = Nothing
ReturnID = 0
Exit Sub

lReturnID = Err.Number
sReturnMsg = Err.Description
End Sub

Reply With Quote
Posts: n/a
      2nd Mar 2006
The problem is solved. The causing comonent was an Add-In in Outlook.
Tools-Options...-Other-Advanced Options...-Add-In Manager... Removing
it and everything worked fine. ...or fix the add-in ;-)

Reply With Quote
New Member
Join Date: Jun 2006
Posts: 1
      8th Jun 2006

I am getting the error while trying to send outlook mail using microsoft excel.
The error is that "The operation cannot be performed because the object has been deleted."

Do somebody have resolution to this problem.


Reply With Quote

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
"operation cannot be performed because the message has been changed"error excel to outlook somethinglikeant Microsoft Outlook VBA Programming 0 2nd Apr 2008 08:43 PM
The operation cannot be performed because the object has been dele =?Utf-8?B?U3VkZWVw?= Microsoft Excel Programming 0 10th Aug 2007 10:26 AM
The operation cannot be performed because the object has been deleted sudeepambekar Microsoft Outlook VBA Programming 0 24th Jul 2007 12:15 PM
operation cannot be performed because object has been deleted =?Utf-8?B?ZmJzb2w=?= Microsoft Outlook Discussion 0 4th Oct 2006 08:05 PM
"operation cannot be performed because object has been deleted" =?Utf-8?B?ZmJzb2w=?= Microsoft Powerpoint 1 4th Oct 2006 04:22 PM




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