+ Reply to Thread
Results 1 to 3 of 3

Can someone help me with following code to increase/faster outlook VBA Macro Speed ?

  1. #1
    Registered User
    Join Date
    12-05-2018
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    2

    Can someone help me with following code to increase/faster outlook VBA Macro Speed ?

    Hi

    Can someone help me with following code to increase/faster outlook VBA Macro Speed ? Currently It taking lot of time run all email rules and getting process slow.



    Sub RunAllInboxRules()
    Dim st As Outlook.Store
    Dim myRules As Outlook.Rules
    Dim rl As Outlook.Rule
    Dim count As Integer
    Dim ruleList As String
    'On Error Resume Next

    ' get default store (where rules live)
    Set st = Application.Session.DefaultStore
    ' get rules
    Set myRules = st.GetRules

    ' iterate all the rules
    For Each rl In myRules
    ' determine if it's an Inbox rule
    If rl.RuleType = olRuleReceive Then
    ' if so, run it
    rl.Execute ShowProgress:=True
    count = count + 1
    ruleList = ruleList & vbCrLf & rl.Name
    End If
    Next

    ' tell the user what you did
    ruleList = "These rules were executed against the Inbox: " & vbCrLf & ruleList
    MsgBox ruleList, vbInformation, "Macro: RunAllInboxRules"

    Set rl = Nothing
    Set st = Nothing
    Set myRules = Nothing
    End Sub

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Can someone help me with following code to increase/faster outlook VBA Macro Speed ?

    Are you sure the delay isn't simply the rules themselves? How long do they take if you run them manually?
    Rory

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,444

    Re: Can someone help me with following code to increase/faster outlook VBA Macro Speed ?

    @nbm

    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html

+ 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. excel VBA increase speed/efficiency to current code
    By Stuepef in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2018, 11:22 PM
  2. [SOLVED] Increase Macro Speed
    By dharmon in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-15-2018, 09:54 AM
  3. looking to increase speed of vba code, I currently use for loops.
    By unrealneoguy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-13-2018, 09:58 AM
  4. Can Someone Please Adjust This Code to Increase Speed?
    By smcmahon83 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2015, 03:09 PM
  5. [SOLVED] Optimizing code speed: Hiding rows with loops - looking for faster way
    By Taktiker in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-07-2012, 04:24 PM
  6. [SOLVED] Can faster CPU+larger/faster RAM significantly speed up recalulati
    By jmk_li in forum Excel General
    Replies: 2
    Last Post: 09-28-2005, 06:05 AM
  7. [SOLVED] Increase macro speed?
    By Valeria in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-14-2005, 05:06 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