PDA

View Full Version : [SOLVED:] Try Catch Block



tools
12-03-2008, 08:43 PM
Hi All,

I am new to VBA . Can anyone tell me if there is something like a try catch and finally block in VBA ? Rather I would ask does VBA support Try Catch Block?

I couldnt find anything related to this . Few threads stated that VBA does not support it and it is supported by VB.Net only.

Thanks and Regards

Kenneth Hobs
12-03-2008, 09:23 PM
You are correct. Use On Error to trap errors. On Error Resume Next can be handy too. Use, On Error Goto 0, to reset a previous On Error.

e.g.
Sub Test()
Dim msg As String
On Error GoTo ErrMsg
Err.Raise 5

Exit Sub
ErrMsg:
If Err.Number <> 0 Then
msg = "Error # " & Str(Err.Number) & " was generated by " _
& Err.Source & Chr(13) & Err.Description
MsgBox msg, , "Error", Err.HelpFile, Err.HelpContext
End If
End Sub

tools
12-03-2008, 09:41 PM
Thanks A lot :)

mancubus
09-05-2014, 05:29 AM
http://www.urbandictionary.com/define.php?term=Gravedigging

Kenneth Hobs
09-05-2014, 07:42 AM
Too funny...

Aflatoon
09-05-2014, 07:52 AM
And quite a lot of it today!

mancubus
09-05-2014, 08:03 AM
@SamT

can you please delete my posts to this thread as well. :)

Aussiebear
09-06-2014, 03:40 AM
@SamT

can you please delete my posts to this thread as well. :)

you bring the drama and we'll sing

Paul_Hossler
09-06-2014, 05:41 AM
http://www.computerhope.com/jargon/n/necropost.htm

SamT
09-06-2014, 06:08 AM
Hey!!! I dint do nothing.. I only sent Nena a PM saying WTF you doing? Prove to ME dat you be human. Or I kick you a** outa here.

Now xld done stole my fun :crying:

mancubus
09-06-2014, 02:03 PM
you bring the drama and we'll sing

no. :)
there was a message before mine.
that's why i posted that link. :)
but it was deleted. i though it was SamT who deleted that message then i requested my messages get deleted as well. :)

mancubus
09-06-2014, 02:07 PM
Hey!!! I dint do nothing.. I only sent Nena a PM saying WTF you doing? Prove to ME dat you be human. Or I kick you a** outa here.

Now xld done stole my fun :crying:

:D

SamT
09-06-2014, 03:11 PM
@Mancubus Now where did I put my BFG9000?

mancubus
09-06-2014, 03:58 PM
:devil2:

starting in 1993, trying to pass the levels in Doom cost me hundreds of sleepless nights.
a friend told me "iddqd" is the cheat code to god Mode in the game and finally i completed all the levels. yes, i cheated, and not ashamed of that. :D
so i thought it would not be a bad idea to take a nick name from the game when signing up a forum whose name i don't remember anymore..
doom, taken; doomguy, taken; space marine, taken; Arch-Vile, taken. mancubus, bingo!
this is the story my weird nickname, mancubus. :)

BFG9000 was my, perhaps all's, favorite gun. no need to mention here, i think, what BFG is the abbreviation of three words. :D

SamT
09-06-2014, 05:01 PM
IIRC, at id, it originally meant Battle(?) Frequency Gun, but we all know what "BFG" really means. I really liked the Chainsaw for anything I could get close to. No wasting precious ammo. Somewhere, I've got a CD with a hunnert versions of Doom on it. And I've got an old box that will run Win95/98. Just need to get a JS.

mancubus
09-08-2014, 12:53 AM
the feast in the brutal mode was also quite satisfactory. :rofl:

there is always more:

http://en.wikipedia.org/wiki/BFG_(weapon)