Object Variable or With Block Not Set Error in Outlook 2016 and not Outlook 2013

Status
Not open for further replies.

Jake

New Member
Outlook version
Outlook 2013 32 bit
Email Account
POP3
Hello,

I've written a macro to iterate through a specific folder in my Outlook and send a canned reply to all emails within. The code to find the folder came from slipstick.com and it has proven very useful however I am having a significant issue.

On my machine and that of another coworker, all of which run Outlook 2013, the macro runs fine. There are no errors, all emails are sent replies, and the people who expect those emails are happy they come each and every time.

I am using the GetFolderPath function from this page:

Working with VBA and non-default Outlook Folders

However there is at least one machine in the office which runs Outlook 2016 and my code is giving me an error when I attempt to execute it there. The error is Object Variable or With Block Not Set. I come to the final iteration of the loop and the function call returns NULL.

Looking at the variables and objects as the If loop runs, I can see some discrepancies between what is happening on my machine and what is happening on the workstation which is receiving an error. On the same iteration of the loop and in the same part of the function, SubFolders.Item(FoldersArray(i)) is set to the name of the folder on the functioning machine however on the machine where the error occurs, it says: <The Attempted Operation Failed. An object cannot be found>.

So naturally, calling the function to retrieve the value of oFolder will result in a NULL value and an error occurs.

Can anyone explain to me why this is the case? I've been trying to wrap my head around this for a few weeks.

Thank you!

*EDIT* typo
 

Jake

New Member
Outlook version
Outlook 2013 32 bit
Email Account
POP3
The email accounts are identical according to my IT staff. They are all POP3 accounts set up with an outside vendor.

Could the object type for the SubFolders object be different between the two Outlook versions?
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
The error simply means the subfolder doesn't exist. There's no difference between the versions of Outlook; however, it looks like the folder hierarchy isn't identical on all your machines.
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
R Macro to copy email to excel - Runtime Error 91 Object Variable Not Set Outlook VBA and Custom Forms 11
R How to get the Items object of the default mailbox of a specific account in a multiple account Outlook? Outlook VBA and Custom Forms 0
A Run time error 424. object required in outlook 2013 Outlook VBA and Custom Forms 10
vodkasoda Object could not be found Error in Outlook 2007 Outlook VBA and Custom Forms 5
S VBA Macro - Run-time error '424': object required - Help Please Outlook VBA and Custom Forms 3
P Automate Outlook Start - No Active Explorer Object Found Using Outlook 10
J Outlook 2016 is killing me with object.links Outlook VBA and Custom Forms 2
S how to access the properties of a contact given distlist.member object Outlook VBA and Custom Forms 1
J An attempt operation failed. An object could not be found at line5. Outlook VBA and Custom Forms 2
R How can I retain embedded object with voting button reply? Using Outlook 5
G run-time 438: object doesn't support this property or method Using Outlook 2
D Operation failed. An object could not be found. Using Outlook 2
K !Task 'mailaccountname' reported error (0x8004010F): The operation failed. An object could not be fo Using Outlook 7
T Can receive but can not send get error: The attemped operation failed, an object can't be found. Using Outlook 3
P Error: Object does not support this method Using Outlook 1
T The ACL for object "<exchange mailbox user>" is not in canonical order Exchange Server Administration 4
D Sync OAB and Task 'Microsoft Exchange' Fails Error 0x8004010F: The operation failed. An object canno Exchange Server Administration 2
D Task "Microsoft Exchange Server" reported error (0x8004010F): 'The operation failed. An object could Exchange Server Administration 3
M Outlook 2010 - The attempted operation failed. An object could not be found. Using Outlook 3
B "The attempted operation failed. An object cannot be found." Using Outlook 7
B (0x8004010f): 'The operation failed. An object could not be found Exchange Server Administration 6
A EdgeSync homeMTA set Deleted object in AD, event 2937-validation Exchange Server Administration 5
P "Can't open this item. The object is not valid." Using Outlook 6
T Outlook2003 can't insert object Using Outlook 4
N "The operation failed. An object cannot be found." when pressing send Using Outlook 2
L Exchange 2010 Management Console crashes when opening exchange object properties. Exchange Server Administration 4
S Outlook 2010. Keep getting the message "An operation failed. an object could not be found" when hitt Using Outlook 1
A Outlook 2010 Rules and Alerts: The operation failed. The object cannot be found. Using Outlook 3
M attempted operation failed. an object could not be found Using Outlook 3
S Task 'Microsoft Exchange Server' reported error (0x8004010F): 'The operation failed. An object could Exchange Server Administration 7
M BCM error: Object reference not set to an instance of the object. Got this msg. BCM database will Using Outlook 2
J 0x8DE00002 Object with Id 5e383750-b80a-4528-87a5-2a5304647a7e appears in more than one [Error] command Using Outlook 9
B Task List in To-Do Bar 'The operation failed. An object could not be found' Using Outlook 3
G Re: OPERATION FAILED. AN OBJECT COULD NOT BE FOUND__ Using Outlook 7
R Rules. object not found Using Outlook 4
A vb6 run time error 5 when Outlook 2007 Explorer object displayed Outlook VBA and Custom Forms 1
M The Operation failed... An object cannot be found Using Outlook 13
N "The operation failed. An object could not be found" error message. when sending email in Outlook 20 Using Outlook 22
P Problem with a Search-Object resulting from an AdvancedSearch Outlook VBA and Custom Forms 2
T How to get Inspector object from Window handle Outlook VBA and Custom Forms 2
M MailItem object has no property for when a reply was sent Outlook VBA and Custom Forms 3
T Complete the object model Outlook Wishlist 0
M Outlook Contact Object: Is there a "last accessed" date-time prope Outlook VBA and Custom Forms 3
M Cannot Send - "Operation failed. An object cannot be found" BCM (Business Contact Manager) 4
K How to disconnect Application.COMAddIns.Item().Object? Outlook VBA and Custom Forms 4
S RDOMail object is not working in different thread. Outlook VBA and Custom Forms 13
G Error in Outlook Object Model with redemption and google apps prem Outlook VBA and Custom Forms 3
C Unable to cast object of type 'System.Int32' to type 'System.Byte[ BCM (Business Contact Manager) 1
S UserProperties of MailItem object. Outlook VBA and Custom Forms 3
P UserProperty of mail object problem while dealing with custom fold Outlook VBA and Custom Forms 2
Similar threads


















































Top