+ Reply to Thread
Results 1 to 3 of 3

Outlook Freezes with macro

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

    Outlook Freezes with macro

    The following VB code checks a list of mailboxes and mails me a message with the number of messages in each mailbox every 15 minutes. The works perfectly except for one problem. If I am composing an email or responding to one when the code kicks off, Outlook Freezes. I put in more DoEvents than code, I think. I also "instrumented" the code to write a log as it takes various steps. It consistently fails at the step indicated. Outlook issues no errors and I kill outlook with the windows task manager and I restart it and it restarts normally with no messages.

    Log extract:
    "11/21/2018 11:13:00 Initalizing Variables"
    "11/21/2018 11:13:00 Initalizing Outlook"
    "11/21/2018 11:13:00 Looping through folders"
    "11/21/2018 11:13:00 Processing Amazon Daily Ops Reports"
    "11/21/2018 11:13:00 Getting number of messages in Amazon Daily Ops Reports"

    The issue is also discussed in this forum: https://www.utteraccess.com/forum/in...&#entry2705093

    This is the code in the ThisOutlookSession Module. It doesn't seem to have a problem
    Please Login or Register  to view this content.
    Here is the complete rest of the code which is in a regular module. The mail workbook routine never crashes. The issue is with the Mail Alert routine.
    Please Login or Register  to view this content.
    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,910

    Re: Outlook Freezes with macro

    I have not been able to keep the program from freezing, however I found a work-around. I can check if a message is open for editing and put in a sleep loop to delay the program until the message is no longer being edited. I will post a link to this solution once I test it and clean up the code.

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

    Re: Outlook Freezes with macro

    Here is the solution: https://www.excelforum.com/tips-and-...ml#post5029090

+ 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. VBA Macro to unhide all sheets, freezes.
    By Rustyroof in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2018, 08:17 AM
  2. Macro freezes when run a second time
    By jacc14 in forum Excel General
    Replies: 4
    Last Post: 12-27-2017, 11:07 AM
  3. Macro freezes... Too many words?
    By labmanager in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-04-2013, 02:10 PM
  4. [SOLVED] Macro freezes spreadsheet
    By davemel in forum Excel General
    Replies: 0
    Last Post: 08-01-2006, 03:30 AM
  5. [SOLVED] Macro freezes after using Filters.
    By davemel in forum Excel General
    Replies: 2
    Last Post: 07-31-2006, 08:48 AM
  6. [SOLVED] navigation macro freezes
    By cmarch in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2005, 08:05 PM
  7. [SOLVED] Macro freezes up Excel
    By Jon Delano in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-11-2005, 03:05 PM

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