+ Reply to Thread
Results 1 to 1 of 1

vbObjectError Not Working as Expected

  1. #1
    Registered User
    Join Date
    12-10-2010
    Location
    California
    MS-Off Ver
    Excel all versions from 5.0 (1993) to 365
    Posts
    38

    vbObjectError Not Working as Expected

    This page:
    https://bettersolutions.com/vba/erro...ing-errors.htm

    says:
    "If you are generating errors, then you should add your number to the vbObjectError constant. Eg Err.Raise Number = vbObjectError + 1000
    The range 513 - 65535 is available for user defined errors"
    Ok, but i did, and got a native error:

    Please Login or Register  to view this content.
    This site
    https://exceldevelopmentplatform.blo...criptions.html

    says the error code for that error-message is
    Please Login or Register  to view this content.
    The VBA immediate pane confirms this:
    Please Login or Register  to view this content.
    bettersolutions.com also says:
    "The range 513 - 65535 is available for user defined errors"
    If i'm supposed to add vbObjectError, and if 513-65535 is usable, then why does `Err.Raise vbObjectError+515` give me a native error!?

    also O'Reilly says:
    "we are left with numbers in the range vbObjectError + 512 to vbObjectError + 65535"
    https://www.oreilly.com/library/view...0/ch09s04.html

    Ok, let's say they mean my custom codes should start at 513, and forget about vbObjectError. But their Codes page shows native errors of 520, 521, some 700's, and some 31000's.
    https://bettersolutions.com/vba/erro...rror-codes.htm

    Microsoft documentation give yet different instructions:
    "User-defined error numbers should be greater than vbObjectError."
    https://docs.microsoft.com/en-us/dot....vbobjecterror
    So, i can start at vbObjectError + 1?

    i'm totally confused.

    Thx!

    also asked here
    http://www.vbaexpress.com/forum/show...ng-as-Expected
    Last edited by johnywhy; 09-29-2021 at 06:08 AM.

+ 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. [SOLVED] Combobox not working as expected
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-22-2021, 01:10 PM
  2. How do I use vbObjectError in Err.Raise
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-29-2020, 02:57 PM
  3. SUM IF not working as expected
    By koalamotorsport in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-28-2019, 11:42 AM
  4. [SOLVED] IF function not working as expected
    By anande in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-30-2019, 12:29 AM
  5. IF AND Formula not working as expected
    By mra1984 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2018, 10:43 AM
  6. COUNTIF() not working as expected?
    By Neely8 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 02-28-2015, 09:28 AM
  7. [SOLVED] VLOOKUP not working as expected.
    By mithandir1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-17-2014, 06:44 PM

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