Results 1 to 16 of 16

Retrieving Outlook folder using GetNamespace causing Runtime error

Threaded View

  1. #1
    Registered User
    Join Date
    12-19-2020
    Location
    San Francisco
    MS-Off Ver
    16
    Posts
    7

    Retrieving Outlook folder using GetNamespace causing Runtime error

    I have a macro that moves the currently selected email to a folder based on a keyword in the subject line matching a folder name. The macro extracts the keyword and then recursively descends the Outlook folder tree beginning with a "startFolder" which I manually define. The macro has been running just fine for months. Then the other day it stopped working.

        Dim OutApp As Outlook.Application
        Set OutApp = New Outlook.Application
        
        Dim Namespace As Outlook.Namespace
        Set Namespace = OutApp.GetNamespace("MAPI")
        
        Dim Folder, startFolder, SubFolder, UserFolder As Outlook.MAPIFolder
                
        Set startFolder = Namespace.Folders("G Suite - xxxxx.com").Folders("Mail Folders").Folders("XXXXX").Folders("Projects")
    ....

    Now the Set statement results in a runtime error:
    Runtime error ' -2147221233 (8004010f)':
    The attempted operation failed. An object could not be found.

    Again, this was working just fine, no changes. I exported the module and reimported just in case it was corrupted (that's solved other problems), but that did not work.
    Last edited by davesexcel; 12-20-2020 at 07:02 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. DatePicker (Eyre) selectdate causing Runtime error 13 if text box empty
    By K_L_C in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-04-2020, 05:13 AM
  2. [SOLVED] Worksheet Change Event Causing Runtime Error 9
    By phelbin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-13-2017, 03:59 PM
  3. excel/outlook runtime error 440
    By Spotniq in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2015, 02:57 AM
  4. PasteSpecial causing RunTime error 1004 & autofill doesn't stop at last line
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-24-2014, 09:18 AM
  5. [SOLVED] Application.Calculate or F9 causing runtime / Visual Basic error
    By baldmosher in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-20-2013, 05:26 AM
  6. Application.Calculate causing Runtime Error
    By quekbc in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-20-2013, 05:14 AM
  7. Why does Outlook.Application.GetNamespace("MAPI") Fail?
    By Lee in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-27-2005, 10:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1