+ Reply to Thread
Results 1 to 3 of 3

Intermittent error on reading sub-folder in Outlook

  1. #1
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Intermittent error on reading sub-folder in Outlook

    With the help of my friends here on this forum, I was able to write an application to read emails from a folder, download the attachments to a windows folder, and move the email into a subfolder. It works well most of the time. However, if it runs into an error, it not only stops, but fails to work from that point on. I was running the program and encountered the error message in the first picture. I stopped the program and ran it again and got the second error message. I closed Excel, re-opened it and ran the program and got the second error message again. The only way to clear the error is to close Excel, close outlook, open outlook and open excel again.

    When it fails, the program always errors on this line:
    Please Login or Register  to view this content.
    Attached Images Attached Images
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Intermittent error on reading sub-folder in Outlook

    To make the issue even muddier, I reset the system and moved the messages that were being processed when the application failed back into the queue to be reprocessed. All processed perfectly without error. Whatever caused the error the first time did not cause it the second time when as far as I can tell nothing else changed.

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Intermittent error on reading sub-folder in Outlook

    My best guess is that something was going afoul with the inter-process communication between excel and outlook. The code was probably trying to open the next email before completing the download of the attachment. So, I sprinkled a bunch of DoEvents throughout the code liberally. Last Friday I downloaded 21 messages without error and this morning, I processed a queue of 51 messages without a glitch. So I am marking this one solved.

    Here is the final code. My thanks again to the people who stepped in to help me with this program. This is a very repetitive task subject to human errror and well worth automating
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Reading a folder in Outlook
    By dflak in forum Tips and Tutorials
    Replies: 0
    Last Post: 03-31-2017, 02:27 PM
  2. Intermittent Unspecified Runtime Error
    By Rclay11541 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-28-2016, 05:05 PM
  3. Variable in a Range Function - Intermittent Error
    By rsmithline in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-21-2015, 09:35 AM
  4. Intermittent, machine dependent Automation Error
    By steve wilson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-02-2015, 11:34 AM
  5. Intermittent error with email generation macro - pasting from excel to outlook mail
    By oenleunc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-15-2014, 05:46 AM
  6. Intermittent Runtime Error when inserting picture
    By vamosj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2009, 04:36 AM
  7. Insert Pic Intermittent runtime error
    By vamosj in forum Access Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2009, 07:01 AM

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