+ Reply to Thread
Results 1 to 2 of 2

accessing excel vba advance filter from outlook

  1. #1
    Forum Contributor
    Join Date
    07-10-2019
    Location
    england
    MS-Off Ver
    2013
    Posts
    486

    accessing excel vba advance filter from outlook

    Hi,
    Why is range method fail occurs, when advance filter is used in outlook to access excel and filter?

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: accessing excel vba advance filter from outlook

    First of all, in your code you need 'Option Explicit' at the top of each Code Module. You have items that assume a value of 0, when there actual value may be something else (e.g. xlFilter).
    The big mistake was comparing the Upper Case File Name to "yyy.XLSM".

    To prevent typos from ruining days and weeks of work 'Option Explicit' is NEEDED at the top of each code module. This prevents errors caused by missspellings and FORCES every variable to be DECLARED (e.g. Dim i as Integer). http://www.cpearson.com/excel/DeclaringVariables.aspx

    The following code works in both Excel and in Outlook (Office 365). Changes from original in red.
    Please Login or Register  to view this content.
    The following should help you develop some basic debugging skills.
    Debugger Secrets:
    a. Press 'F8' to single step (goes into subroutines and functions).
    b. Press SHIFT 'F8' to single step OVER subroutines and functions.
    c. Press CTRL 'F8' to stop at the line where the cursor is.
    d. 'Left Click' the margin to the left of a line to set (or clear) a BREAKPOINT.
    e. Press CTRL 'G' to open the IMMEDIATE WINDOW. 'debug.print' statements send their
    output to the IMMEDIATE WINDOW.
    f. Select View > Locals to see all variables while debugging.
    g. To automatically set a BREAKPOINT at a certain location put in the line:
    'Debug.Assert False'
    h. To conditionally set a BREAKPOINT at a certain location put in lines similar to:
    if i >= 20 and xTV20 > 99.56 then
    Debug.Assert False
    endif
    i. A variable value will be displayed by putting the cursor over the variable name.

    To manually set a breakpoint, see http://www.wiseowl.co.uk/blog/s196/breakpoints.htm

    Lewis
    Attached Files Attached Files

+ 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. Accessing Outlook from Excel
    By McR0biotic in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-17-2019, 03:18 AM
  2. Excel Advance Filter
    By ej25lol in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-13-2016, 05:37 PM
  3. Accessing an outlook message via an excel macro
    By jeskit in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-10-2011, 06:38 AM
  4. Excel 2007 : Advance filter with a Button in Excel
    By SEHRA in forum Excel General
    Replies: 3
    Last Post: 06-01-2011, 12:39 PM
  5. Problem with Excel accessing an Outlook email body
    By krussell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2009, 04:15 PM
  6. Accessing Outlook address list via excel
    By madbloke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2007, 03:55 PM
  7. Accessing Excel data through Outlook 2003
    By echostorm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2006, 12:45 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