Consulting

Results 1 to 12 of 12

Thread: Error Message, Warning Message: List/Database

  1. #1

    Error Message, Warning Message: List/Database

    I have inquired about a reference regarding VBA Error Messages, on several prior occassions. I have yet to find one, nor anyone who knew of any, so it might be a good time to start one. If in fact this is the case, that none do exist, I would like to create one and contribute it to VBAx.

    I would like to publish the following information, Error Message Title, Error Message, the current method where this occurred, resolution required, an example if possible, and contributor's user name,(anonymous if you prefer not to be credited for the submission), date of submission (w/ different date formats, please use the long text version), and any pertient comments that will help the user understand better.
    If possible Please: Contributions should be reproduced exactly as shown, Upper/Lower case structure, punctuation, etc...

    If there are other details that might be useful please feel free to comment on this.

    Example of Contribution:
    Error Message Title: ....Compile error:
    Error Message: ...........Next without For
    Method: ....................For...Next Loop
    Resolution: ................Unpaired End If, additonal End If added
    Contributor: ...............YellowLabPro
    Date: .......................June 12, 2007
    Comments:.................Next without For message immediately conjures the notion to look at the loop constructs, where in this case, the ommission of the matching End If prevents the loop from closing, wherein the matching End If is required, not a missing Next.

    Example:
    Problem Code:
    [vba]
    Option Explicit
    Sub Test()
    Dim cel As Range
    For Each cel In Cells.UsedRange
    If cel = "" Then
    cel.Interior.ColorIndex = 6

    Next
    End Sub
    [/vba]

    [vba]
    Resolution:
    Option Explicit
    Sub Test()
    Dim cel As Range
    For Each cel In Cells.UsedRange
    If cel = "" Then
    cel.Interior.ColorIndex = 6

    ------------------------------
    'Missing End If Below
    ------------------------------
    End If
    Next
    End Sub
    [/vba]Contributions can be either posted to this thread or emailed directly to me at, DougPoBox@aol.com

    Thanks for everyone's contributions in advance.

    Doug
    aka "YLP"
    Last edited by YellowLabPro; 08-12-2007 at 05:37 AM.
    my site: www.ecboardco.com
    was built w/ a majority of the assistance from the board members here... thanks VBAX.

    Just because I see something, doesn't mean that what's actually happening is what I see.

    You don't get from 0-90 by standing still!

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    In this example, there is a secondary reason, which may not be as obvious and should be included.
    Example of Contribution:

    Error Message Title: ....Compile error:
    Error Message: ...........Next without For
    Method: ....................For...Next Loop
    Other causes: ............Unpaired If/End If
    Resolution: ................Additional End If added
    Contributor: ...............YellowLabPro
    Date: .......................June 12, 2007
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    For a list
    [vba]Sub ErrList()
    Dim i
    For i = 1 To 750
    Cells(i, 1) = i
    Cells(i, 2) = Error(i)
    Next
    End Sub[/vba]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Why stop at 100? Most after 100 are Application/object errrors, but there are others. This also shows the big problem, several error messages have a myriad of causes.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Changed to 750.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  6. #6
    Great idea! Why not take this a step farther and create a sub-forum called "Excel Error Message Help"?

  7. #7
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Example of Contribution:
    Error Message Title: ....Compile error:
    Error Message: ...........Object variable or With block variable not set
    Method: ....................Multiple
    Other causes: ............Missing reference
    Resolution: ................Check for missing references; remove check mark
    Contributor: ...............MD
    Date: .......................August 26, 2007
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  8. #8
    Administrator
    2nd VP-Knowledge Base VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    Shouldn't we add the Error number too?

    Quote Originally Posted by xld
    This also shows the big problem, several error messages have a myriad of causes.
    It would be nice to have a collection of typical errors that have the same number associated with them.




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  9. #9
    Joseph - Good Point,
    Yes if the error received has a numerical value then include it w/ the submission and I will add it to the table.

    Thanks,

    Doug
    my site: www.ecboardco.com
    was built w/ a majority of the assistance from the board members here... thanks VBAX.

    Just because I see something, doesn't mean that what's actually happening is what I see.

    You don't get from 0-90 by standing still!

  10. #10
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by malik641
    Shouldn't we add the Error number too?


    It would be nice to have a collection of typical errors that have the same number associated with them.

    I was talking more of the fact that many errors have different numbers, but the same description, presumably because it is a different underlying cause.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  11. #11
    Administrator
    2nd VP-Knowledge Base VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    Oh. My bad.

    But I still think we should add the error number to these entries.




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  12. #12
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    No postings here for months, so I'm unsticking this thread.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •