Never the same Err.Number

  • Thread starter Thread starter George Hester
  • Start date Start date
G

George Hester

Here is my Error Handler:

oscSel_Err:
MsgBox "Error is: " & Err.Description & vbCrLf & _
"Error number is: H" & Hex(Err.Number)
Err.Clear
GoTo oscSel_Exit
End Sub

Now the error is always Array out of bounds. But the error number is never
the same. How do I insure for a particular error description the
corresponding error number is ALWAYS the same?
 
If an application throws different numbers for the same error then you're
lost, except you want to write your own table for translation.

My opinion: In most cases you don't need an error number.

Is it again your class terminates problem? For debugging it could help if
you tick under Tools/Options/General 'Break on All Errors'.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Keep your Outlook categories organized!
http://www.shareit.com/product.html?productid=300120654&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am Tue, 6 Feb 2007 23:32:17 -0500 schrieb George Hester:
 
Not that issue you explained it enough for me. I am inadvertantly crashing
the Project like typing mdgbox "1" and hitting ENTER while writing code.
That busts the Project and oh well. I can't start the Class again except by
starting Outlook and so there we go.

I will try that Tools suggestion. But to be honest with you the errorr
numbers seems to be completely random. I mean just because we may never
need them is not a good reason for this problem. If that were true the
Err.Number should be rermoved.

Here's another ding dong in VBA. I hit a Control Button that a COM+
application free on the Net has available, which moves a mailitem out of a
folder. So you would think the Item_Remove event would be called. Well
have you ever looked at the Item_Remove sub it has no arguments so you
cannot identify the removed item as you can with the Item_Add sub. OK I
suppose I can work around that. But here is the kicker. Even though the
COM+ application moves an Item out of a folder when a command button is
clicked, the Item_Remove event does not fire. If I grab a mailitem in the
folder with the mouse and move it out with the mouse, oh that calls the
Item_Remove event just fine That one has me stumped.

Maybe this is just a flaw of the COM+ application I don't know but this is
another thing I have to work around. Also I am finding I have to use
Debug.Print instead of MsgBox's because sone of the code in the class
doesn't run when MsgBox's are fired from its subs.

Lastly using UsingProperties. The third argument in the Add method is a
boolean about whether the property should appear as a field in the folder
when customized viewed. Well nope. My property is called MySpam and it
does not appear in the available fields in the customize view dialog box.
Stumped on that one too.

I'm OK plodding along here. Thanks for all your prior help you've been very
patient with me and my spelling.
 
Yes, especially with your spelling :-) For me it's very hard to tell
whether you have a lot of typos or use words I simply never read. Your first
sentence is an excellent sample:

'Note, that issue you explained is enough for me.'

For me that would make sense. But what you wrote instead confuses me; I
can't translate that.

You should understand that any upcoming error message doesn't mean your
project crashes. Instead the compiler tells you there're errors before the
project could crash.

What you describe is what I call an absolutely nonsensically setting,
unfortunetaly it's still default: Go to Tools/Options, uncheck the first box
(something like 'check syntax automatically') and check the next (variable
declaration necessary).

By unchecking the first box, you can now enter every nonsense and hit enter
without getting an error. Before running the project click Debugging/Compile
Project, the compiler then tells you where things are wrong.

Item_Remove doesn't fire e.g. if the last item is being removed. You also
have to look at SelectionChange.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Keep your Outlook categories organized!
http://www.shareit.com/product.html?productid=300120654&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)


Am Wed, 7 Feb 2007 03:20:39 -0500 schrieb George Hester:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top