12. November 2013 · Write a comment · Categories: Uncategorized
So I'm really stuck.  I have a macro built that moves messages from my inbox to a subfolder.  It works fine for me so I am trying to help a remote co-worker set up the same thing.  When he runs it he gets the error message "The attempted operation failed.  An object could not be found." Trying to debug it brings him to the 3rd line below:
Sub MoveToFolder(folderName)
....other code....

Set olDestFolder = olNameSpace.Folders(mailboxNameString).Folders("Inbox").Folders(folderName)


This is driven by the following sub routine:


Sub BMRT()

MoveToFolder ("BMRT")

End Sub


I was able to recreate the error on my box by adding a space to the folder name in one of my sub routines.  But we checked his folder name and there is no spaces or other mismatch we can find.  


I'm thinking it has GOT to be either in the naming of the mailboxNameString or the contents of the parentheses after the .folder(here).  I can check the mailboxNameString, "Inbox", and folderName,  for an exact match and they all seem to be correct.  Any suggestions for where else we might look to find this?  


TIA

ed

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.