Run-time error 424 Object required error, 1 user

logandiana

Board Regular
Joined
Feb 21, 2017
Messages
110
I created the following code in Outlook YEARS ago and 30+ people in our department still use this code every day with no issue. Each time we get a new employee it gets added to their machine and they are good to go.
I have 1 person where the code doesn't work for some reason. It throws the same 424 Object required error every time, as soon as it tries to process the line objDrafts.Item(i).Send

VBA Code:
Sub SendDrafts()

Dim objDrafts As Outlook.Items
Dim i As Long

Set objDrafts = Outlook.Application.Session.GetDefaultFolder(olFolderDrafts).Items
For i = objDrafts.Count To 1 Step -1

If Left(objDrafts.Item(i).Subject, 17) = "Current Statement" Or Left(objDrafts.Item(i).Subject, 16) = "Missing Contacts" Then
    objDrafts.Item(i).Send
End If
Next
MsgBox "Emails Sent" & vbNewLine & vbNewLine & "Have a nice day"
End Sub

I don't know why it works on everybody elses computer including mine, but not hers. We've loaded it the same way as everybody else. We've deleted her outlook profile and reloaded everything thrice.
What can I try?
 
I have 1 person where the code doesn't work for some reason.
I have had some items that could not be read, in those cases I have used On Error Resume Next, try:

Rich (BB code):
Sub SendDrafts()

Dim objDrafts As Outlook.Items
Dim i As Long

Set objDrafts = Outlook.Application.Session.GetDefaultFolder(olFolderDrafts).Items

On Error Resume Next

For i = objDrafts.Count To 1 Step -1
If Left(objDrafts.Item(i).Subject, 17) = "Current Statement" Or Left(objDrafts.Item(i).Subject, 16) = "Missing Contacts" Then
    objDrafts.Item(i).Send
End If
Next

On Error GoTo 0

MsgBox "Emails Sent" & vbNewLine & vbNewLine & "Have a nice day"
End Sub
 
Upvote 0
I've tried this, in fact I had it in the code already but took it out to do some testing because none of the employees emails were actually sending. You'd hit run with 175 emails in the drafts folder and it would immediately give the finished message because on each one its getting the same error but skipping over it. But none of the emails would actually send.
So if I add the on error back in, the code will run just fine, just none of the emails will ever leave the drafts folder.

I was thinking this issue might have something to do with permissions, or a reg edit needed or something. Just don't know what or where to look.
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top