Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Catching an error

I'm trying to implement the try/catch structure that Java
provides in VBA. I want to try a line of code, if it
returns an error, I want to be able to catch it and return
a message box to the user of my program indicating that
they performed an illegal action. I cannot figure out how
to do this, if anyone can help me, I would be very
appreciative.
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Catching an error

At the beginning of said code, write the line:

On Error GoTo ErrorCatcher

and include somewhere the label:

ErrorCatcher:

followed by the code too be executed in teh event of an
eror. P.S. It doesn't have to be named "ErrorCatcher."
You can use any valid identifier. - Pikus
-----Original Message-----
I'm trying to implement the try/catch structure that Java
provides in VBA. I want to try a line of code, if it
returns an error, I want to be able to catch it and

return
a message box to the user of my program indicating that
they performed an illegal action. I cannot figure out

how
to do this, if anyone can help me, I would be very
appreciative.
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MACRO: Catching only filled cell data sumit Excel Discussion (Misc queries) 1 November 24th 06 12:28 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
CATCHING DUPLICATE INFORMATION IN DIFFERENT CELLS SAME PROGRAM Lisa Setting up and Configuration of Excel 1 July 20th 06 05:21 PM
[how to] VBA catching close/print in printpreview Héctor Miguel Excel Programming 0 August 16th 03 02:28 AM


All times are GMT +1. The time now is 01:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"