YellowLabPro
08-12-2007, 04:41 AM
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:
Option Explicit
Sub Test()
Dim cel As Range
For Each cel In Cells.UsedRange
If cel = "" Then
cel.Interior.ColorIndex = 6
Next
End Sub
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
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"
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:
Option Explicit
Sub Test()
Dim cel As Range
For Each cel In Cells.UsedRange
If cel = "" Then
cel.Interior.ColorIndex = 6
Next
End Sub
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
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"