Results 1 to 6 of 6

Thread: Error trapping with VBA in Excel for Mac

  1. #1
    Join Date
    May 2009
    Posts
    637

    Error trapping with VBA in Excel for Mac

    Hi friends,
    I am new user for the Visual Basic Application that are done in the Excel. I have installed the MS Office only to learn about it. I want to know how to trap any error with Visual Basic for Applications in Excel. Since my operating system is Mac, I want some information about the trapping of errors for the Mac. So please tell me about an Error trapping with VBA in Excel for Mac.!! Hope that you got my point.!!

  2. #2
    Join Date
    May 2008
    Posts
    376

    Re: Error trapping with VBA in Excel for Mac

    To prevent the blocking or unpredictable behavior of the application, you can include macro code that intercepts the error and tells the macro how to manage it. The intercept and process error handling at run time is called "error trapping. The set of instructions indicating how to manage the application error is called" routine management error "or "Manager error." When a runtime error occurs in a macro Microsoft Visual Basic for Applications, an error message appears and the macro stops or it behaves unpredictably.

  3. #3
    Join Date
    May 2008
    Posts
    353

    Re: Error trapping with VBA in Excel for Mac

    The On Error statement, Visual Basic for Applications to start or stop error trapping. The On Error statement also specifies a set of instructions to execute if an error is detected. Err function returns the number of errors encountered. Example of function Err is as follows :
    Code:
    Msgbox "The most recent error number is " & Err & _
          ". Its message text is: " & Error(Err)

  4. #4
    Join Date
    Aug 2006
    Posts
    209

    Re: Error trapping with VBA in Excel for Mac

    The Error statement simulates the occurrence of an error by letting you assign a number of custom error function Err. These error values defined by the user-are values that you define for your procedures and are still stored in variables of type Variant. A common use for this type of error value is in procedures that accept several arguments and return value. For example, the value returned is valid only if the arguments fall within a certain range. Your procedure can test the arguments which provides the user, and if the arguments are not within the acceptable range, you can ensure that the procedure return the appropriate error value.
    Blessings to you

  5. #5
    Join Date
    Aug 2006
    Posts
    287

    Re: Error trapping with VBA in Excel for Mac

    Error is a subtype of Variant and when the term "error value" is used, it usually means that a variable is of type Variant and contains a value Visual Basic for Applications recognizes as an error defined by the user. Error values are used in a procedure to indicate that error conditions have occurred. Unlike normal run-time errors, these errors do not interrupt your code because they are regarded as ordinary variables and no errors. Your procedures can test these values of error and take appropriate corrective action.
    Dimension 1100 (FMY032J) mini-tower
    2.53ghz Intel Pentium 4
    80 gig nfts HDD
    512 RAM
    Main circuit board: Dell 0CF458
    BIOS: Dell A00
    Display: Intel(R) 82865G Graphics Controller [Display adaptor]
    Multimedia: Sound MAX Integrated Digital Audio
    Windows XP Home SP2

  6. #6
    Join Date
    Sep 2005
    Posts
    1,306

    Re: Error trapping with VBA in Excel for Mac

    You can also use the Error statement to simulate run-time errors. This is particularly useful when you test your applications or when you want to treat a particular condition as being equivalent to a runtime error. Any error Visual Basic for Applications in performance can be simulated by providing the error code for error in an Error statement. You can also use the Error statement to create your own errors defined by the user by providing an error code that does not correspond to an error Visual Basic for applications at runtime. The table contains a list of errors integrated displayed earlier in this section (under "Err Function"). At this point, Visual Basic for Applications does not use all available numbers for built errors. In future versions of Visual Basic for Applications, the internal numbers will increase as more built - errors are added.

Similar Threads

  1. Replies: 6
    Last Post: 09-04-2012, 12:04 PM
  2. Replies: 6
    Last Post: 17-02-2012, 01:18 PM
  3. Replies: 5
    Last Post: 21-01-2012, 05:52 PM
  4. Trapping groundhogs in FrontierVille
    By Chakrika in forum Video Games
    Replies: 4
    Last Post: 09-02-2011, 10:12 AM
  5. Replies: 3
    Last Post: 20-01-2011, 11:00 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,043,335.66109 seconds with 17 queries