Excel vba error list

excel vba error list

Errors in Excel are different – from “Division by Zero” (#Div/0) and #Name to #REF! and #Num. There are lots of ways to summarize these into. VBA error for a code I created to show list box values into Excel. List is multi select single and items are added by using Add Item. Object doesn't support this action.

Similar video

Fixing Excel VBA (Macro) Compile Error For Next, Do Loop, While Wend

Excel vba error list - think

List of Runtime Error Codes

  • 05-23-2007, 05:20 PM#1

    DCSwearingen is offline
    Forum Contributor

    List of Runtime Error Codes

    I thought I had seen a VBA routine that would return a listing of the VBA Runtime error codes and what they mean.

    I know I have seen such a routine in Access97 VBA, but am not sure it will work in Excel.

    I am not sure this is even possible, but if it is would it be possible to post the code that will return a list of the codes and what they mean?

    If it isn't possible, please let me know that as well.

    One more thing...
    This is not a cross post, as I had posed a similar question in the Miscellaneous Forum, but I deleted that post as I realized it was in the wrong forum.
    Thanks!
    Dennis

    I am using Windows 7 and Office 2007, all of my posts are based on this.

  • 05-23-2007, 05:44 PM#2


  • 05-24-2007, 08:47 AM#3

    DCSwearingen is offline
    Forum Contributor

    Thank You!

    This is the list I was looking for.

    For some reason I thought there was a VBA routine that would return the list to an Excel sheet, but this works for me!!

  • 08-21-2013, 09:13 PM#4

    MSC_GG is offline
    Registered User

    Lightbulb Macro to get the list of runtime errors

    Hello,
    Sorry to unearth this old thread.

    QuoteOriginally Posted by DCSwearingenView Post

    For some reason I thought there was a VBA routine that would return the list to an Excel sheet

    Indeed there is a way in Excel to programmatically retrieve a listing of all VBA built-in runtime errors that are available on your platform. For example, you can paste the code below in a module of an empty workbook (successfully tested in Excel 2007).

    Note that I parse error codes from 1 to 1000 (see variable MaxErrNo): that’s because, in my Excel 2007, the highest built-in error code is 746. But you can actually parse the error codes up to 65535 (see the link already posted by VBA Noob), it will just take longer to execute the macro.

    Of course this could be improved by handling unexpected errors, adding a button on the 1st worksheet, displaying progress, storing the error codes and descriptions in a Dictionary object, etc.

    Last edited by MSC_GG; 08-21-2013 at 09:15 PM. Reason: Changed the title


  • Excel VBA Tutorial Part 10 - VBA Error Types

    VBA Error Types

    There are three types of VBA error that you may encounter when executing an Excel macro. These are:

    These three VBA error types are discussed in turn, below.


    Compile Errors

    Compile Errors are recognised by the VBA compiler as being illegal and therefore, are highlighted as errors before your macro even starts to run.

    If you type in a syntax error, the VBA editor will immediately highlight this, either by popping up a message box or by highlighting the error in red, depending on the setting of the Auto Syntax Check option (see rightabove).

    Alternatively, a compile error may be detected when the code is compiled, just before being executed.


    VBA Compile Error Message Box

    A compile error is generally easy to fix, as the VBA compiler pops up a message box, which provides information on the nature of the error.

    For example, if you get the message "Compile error: Variable not defined" when you attempt to run your code, this indicates that you are referencing a variable that has not been declared in the current scope. (This error is only generated when you are using Option Explicit).


    Runtime Errors

    VBA Runtime Error Message Box

    Runtime errors occur during the execution of your code, and cause the code to stop running. This type of VBA error is also usually relatively easy to fix, as you will be given details of the nature of the error, and shown the location where the code has stopped running.

    For example, if your code attempts to divide by zero, you will be presented with a message box, which states "Run-time error '11': Division by zero".

    Depending on the structure of your VBA project, you may be given the option to debug the code, (see below). In this case, clicking on the Debug button on the debug message box, causes the line of code that generated the VBA error to be highlighted in your vba editor.

    VBA Runtime Error Message BoxVBA Runtime Error Code Debugging

    In the above example, the information provided in the message box, and the highlighted line of code, make it very easy to spot the cause of the error.

    If your code is more complex, you can gain further information on the reason for the VBA error by looking at the values of the variables in use. This can be done in the VBA editor by simply hovering your mouse cursor over the variable name, or by opening the local variables window (by selecting View→Locals Window).

    The different runtime error codes are explained on the Microsoft Support Website. However, some of the more common VBA error messages are shown in the table below:


    Trapping Runtime Errors

    Some runtime errors may not be caused by faulty code. For example, if you need to open a file, that contains essential data for your macro, you can't avoid the generation of a VBA error, if the file does not exist. In these types of cases, it is far more professional to 'trap' the error, and write VBA code to handle it, so that your macro exits gracefully, rather than having your macro crashing.

    In order to assist with runtime error trapping, VBA provides us with the On Error and the Resume statements. These statements capture a runtime error and divert the macro into a specified section of VBA code, where the error is handled. After the error handling code has run, the programmer can request that the VBA code resumes from the point of the error, or alternatively, the macro can be terminated cleanly. This is shown in the example code below.


    Sub Set_Values(Val1 As Double, Val2 As Double)

    Dim DataWorkbook As Workbook

    On Error GoTo ErrorHandling

    Set DataWorkbook = Workbooks.Open("C:\Documents and Settings\Data")

    Val1 = Sheets("Sheet1").Cells(1, 1)
    Val2 = Sheets("Sheet1").Cells(1, 2)

    DataWorkbook.Close

    Exit Sub

    ErrorHandling:

    MsgBox "Data Workbook not found;" & _
           "Please add the workbook to C:\Documents and Settings and click OK"
    Resume

    End Sub

    In the above example, the code attempts to open the Excel File 'Data' and if it fails to find the specified file, prompts the user to place the data file into the correct folder. Once the user does this and clicks OK, the code is resumed and a further attempt is made to open the file. If desired, instead of re-trying the file, the Sub procedure could be terminated at this point, by using the Exit Sub command.


    Logical Errors

    Logical Errors, otherwise known as 'bugs', occur during the execution of the VBA code, and allow the code to continue to run to completion. However, the 'bug' may cause the macro to perform unexpected actions or return an incorrect result. These errors are the most difficult to detect and fix, as there is no way that the VBA compiler can identify and 'point to' the error, in the way that it does for compile and runtime errors.

    For example, you may accidentally code your macro to add together the wrong variables in a procedure. The result would be incorrect, but the macro would (usually) continue to run to completion.

    The Excel VBA editor provides a number of debugging tools to assist you in finding logical errors in your VBA code, so that they can be fixed. These tools are currently beyond the scope of this page. However, an introduction to debugging VBA is provided on the TechOnTheNet Website.

    View Excel Macro Examples
    Return to the Excel VBA Tutorial Page


    4SS_ERR_ERRORAn error specific to the data provider or a generic error that cannot be mapped to a value.2SS_NO_GRID_ON_SHEET_BUT_FUNCTIONS_SUBMITTED

    The function ran successfully; however, the function sheet that was submitted contained no grid.

    1SS_SHEET_NOT_CONNECTED_BUT_FUNCTIONS_SUBMITTED

    The function ran successfully; however, the function sheet that was submitted was not connected.

    0SS_OKThe function ran successfully.-1SS_INIT_ERRInitialization error.-2SS_TERM_ERRTermination error.-3SS_NOT_INITInitialization error.-4SS_NOT_CONNECTEDThe spreadsheet is not yet connected to the server.-5SS_NOT_LOCKEDThe spreadsheet is not locked.-6SS_INVALID_SSTABLE The spreadsheet has become unstable.-7SS_INVALID_SSDATAThe spreadsheet contains invalid data.-8SS_NOUNDO_INFONo Undo information exists.-9SS_CANCELEDOperation has been canceled.-10SS_GLOBALOPTSNot used.-11SS_SHEETOPTSNot used.-12SS_NOTENABLED Undo is not enabled.-13SS_NO_MEMORYNot enough memory resources are available.-14SS_DIALOG_ERRORAppropriate dialog box could not be displayed.-15SS_INVALID_PARAMFunction contains an invalid parameter.-16SS_CALCULATINGCalculation is in progress.-17SS_SQL_IN_PROGRESSObsolete setting.-18SS_FORMULAPRESERVEOperation is not allowed because the spreadsheet is in formula preservation mode.-19SS_INTERNALSSERROROperation cannot take place on the specified sheet.-20SS_INVALID_SHEET Current sheet cannot be determined.-21SS_NOACTIVESHEETSpreadsheet name was not specified and no active sheet is selected.-22SS_NOTCALCULATINGCalculation cannot be canceled because no calculation is running.-23SS_INVALIDSELECTIONSelection parameter is invalid.-24SS_INVALIDTOKENNot used.-25SS_CASCADENOTALLOWEDCascade list file cannot be created, or you are attempting to cascade while the spreadsheet is embedded in another document.-26SS_NOMACROSSpreadsheet macros cannot be run due to a licensing agreement.-27SS_NOREADONLYMACROSSpreadsheet macros which update the database cannot be run due to a licensing constraint.-28SS_READONLYSSYou have a read-only license and cannot update the database.-29SS_NOSQLACCESSObsolete setting.-30SS_MENUALREADYREMOVEDThe menu is removed already.-31SS_MENUALREADYADDEDThe menu is added already.-32SS_NOSPREADSHEETACCESSNot used.-33SS_NOHANDLESNot used.-34SS_NOPREVCONNECTIONNot used.-35SS_LROERRORNot used.-36SS_LROWINAPPACCESSERRNot used.-37SS_DATANAVINITERRNot used.-38SS_PARAMSETNOTALLOWEDNot used.-39SS_SHEET_PROTECTEDThe specified worksheet is protected. Unprotect the worksheet and try the operation again.-40SS_CALCSCRIPT_NOTFOUNDCalc script not found.-41SS_NOSUPPORT_PROVIDERProvider not supported.-42SS_INVALID_ALIASInvalid alias.-43SS_CONN_NOT_FOUNDConnection not found.-44SS_APS_CONN_NOT_FOUNDProvider Services connection not found.-45SS_APS_NOT_CONNECTEDProvider Services not connected.-46SS_APS_CANT_CONNECTProvider Services cannot connect.-47SS_CONN_ALREADY_EXISTSConnection already exists.-48SS_APS_URL_NOT_SAVEDProvider Services URL not saved.-49SS_MIGRATION_OF_CONN_NOT_ALLOWEDMigration of connection not allowed.-50SS_CONN_MGR_NOT_INITIALIZEDConnection manager not initialized.-51SS_FAILED_TO_GET_APS_OVERRIDE_PROPERTYFailed to get Provider Services override property.-52SS_FAILED_TO_SET_APS_OVERRIDE_PROPERTYFailed to set Provider Services override property.-53SS_FAILED_TO_GET_APS_URLFailed to get Provider Services URL.-54SS_APS_DISCONNECT_FAILEDProvider Services disconnect failed.-55SS_OPERATION_FAILEDOperation failed.-56SS_CANNOT_ASSOCIATE_SHEET_WITH_CONNECTIONCannot associate sheet with connection.-57SS_REFRESH_SHEET_NEEDEDWorksheet refresh needed.-58SS_NO_GRID_OBJECT_ON_SHEETNo grid object on sheet.-59SS_NO_CONNECTION_ASSOCIATEDNo connection associated.-60SS_NON_DATA_CELL_PASSEDNon-data cell passed.-61SS_DATA_CELL_IS_NOT_WRITABLEData cell is not writable.-62SS_NO_SVC_CONTENT_ON_SHEETNo Smart View content on sheet. -63SS_FAILED_TO_GET_OFFICE_OBJECTFailed to get Office object.-64SS_OP_FAILED_AS_CHART_IS_SELECTEDOperation failed because chart is selected.-65SS_EXCEL_IN_EDIT_MODEExcel in edit mode.-66SS_SHEET_NON_SMARTVIEW_COMPATIBLESheet not compatible with Smart View. -67SS_APP_NOT_STANDALONEApplication not stand alone.-68SS_SMART_VIEW_DISABLEDSmart View is disabled. -69SS_VBA_DEPRECATEDThe function has been deprecated.-70SS_OPERATION_NOT_SUPPORTED_IN_MULTIGRID_MODEThe operation is not supported in worksheets that are in multiple-grid mode.-71SS_INVALID_MEMBERThe member name is invalid. Used with HypGetMemberInformation.-72SS_NO_SV_NAME_RANGENo named ranges are available. Used with HypGetNameRangeList.-73SS_AMBIGUOUS_MENUThe menu item is ambiguous and could not be resolved. Used with HypExecuteMenu, HypHideRibbonMenu, and HypHideRibbonMenuReset.

    Excel Made Easy

    Vba error codes in Excel

    As seen from the previous chapter, there are two types of errors in VBA and within each type, there are a number of subsets.

    For example, the compile time error may be due to wrong syntax, unassigned variable,undeclared variable or wrong placement of the keywords and so on.

    Similarly, there are a number of reasons for runtime error too.

    But, all the errors, irrespective of the type, has some number (code) associated with it.

    These codes help identify the errors easily, since each code corresponds to a particular error only and always.

    For example, error code 6 always implies an overflow.

    There are a number of error codes in VBA, some of which are as follows:

    51 : Internal error.

    52 : Bad Filename or number.

    53 : File not found.

    54 : Bad File mode.

    55 : File already open.

    57 : Device lnput/Output (l/O) error.

    58 : File already exists.

    59 : Bad record length.

    61 : Disk full.

    62 : Input past and of ?le.

    63 : Bad record number.

    67 : Too many files.

    68 : Device unavailable.

    70 : Permission denied.

    71 : Disk not ready.

    74 : Can't rename with different drive.

    75 : Path/File access error.

    76 : Path not found.

    321 : Invalid file format.

    322 : Can�t create necessary temporary file.

    325 : Invalid format in resource file.

    380 : Invalid property value.

    381 : Invalid property array index.

    382 : Set not supported at runtime.

     

    You can find similar Excel Questions and Answer hereunder

    1) What is the design mode in the developer Tab in Excel

    2) Vba clear the contents of an entire sheet in Excel

    3) I have a cell with nested formulas that returns an error. In Excel, how can I step through the formulas to help with debugging?

    4) How to handle errors in VBA with the handling error methods

    5) Is there a way I can average a range of numbers even if there is an error value in range?

    6) How to copy files in Excel VBA is explained here

    7) Find and count instances of a character in a string in Excel

    8) What are the different type of errors in Excel VBA, subscript out of range, compile error, time out, run time overflow

    9) The scenario manager in Excel VBA allows to explore various scenarios in a very easy way

    10) How do you know which column was used last, Here the explanation to find it with VBA

     

    VBA – Make a list of the formula errors in an Excel

    SubErrorDataSummary()

     

        DimmyCell AsRange

        DimmyDict AsObject

     

        SetmyDict=CreateObject("Scripting.Dictionary")

        

        Dimwks AsWorksheet

        DimerrorName AsString

        

        ForEachwks InThisWorkbook.Worksheets

            ForEachmyCell Inwks.UsedRange

                IfIsError(myCell)Then

                    errorName=myCell.Text&" in "&wks.Name

                    IfmyDict.exists(errorName)Then

                        myDict(errorName)=myDict(errorName)+1

                    Else

                        myDict(errorName)=1

                    EndIf

                EndIf

            NextmyCell

        Next

     

        DimmyKey AsVariant

        ForEachmyKey InmyDict.keys

            Debug.Print myKey;myDict(myKey)

        Next

     

    EndSub

    Syntax

    Err.Number

    Description

    A read-write property containing a long value that represents the error code for the last error generated.

    Rules at a Glance

    • When a runtime error is generated within the program, the error code is automatically assigned to Err.Number.

    • The Number property is updated with an application-defined error whose code is passed as an argument to the Err.Raise method.

    • When using the Err.Raise method in normal code, your user-defined error codes can't be greater than 65536 and less that 0. (For an explanation, see the final note in Section 7.1.6 of the entry for the Err.Raise method.)

    • VBA error numbers in the range of 1–1000 are for its own trappable errors. In addition, error numbers from 31001 to 31037 are also used for VBA trappable errors. In implementing a series of application-defined errors, your error handlers should either translate application errors into VBA trappable errors or, preferably, assign a unique range to application-defined errors.

    • When using the Err.Raise method in ActiveX objects, add the constant. (–2147221504) to your user-defined error code to distinguish OLE errors from local application errors.

    • When control returns to the local application after an error has been raised by the OLE server, the application can determine that the error originated in the OLE server and extract the error number with a line of code like the following:

      Dim lError as Long If Err.Number And vbObjectError Then _ lError = Err.Number ...

    Get VB & VBA in a Nutshell: The Language now with the O’Reilly learning platform.

    O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.

    Start your free trial

    excel vba error list

    Share your: Excel vba error list

    Error in socket lo code10 at clientserver
    Sata dma-driver error crc error
    STOP C00002LA UNKNOWN HARD ERROR
    Ora-12154 oracle error

    Syntax

    Err.Number

    Description

    A read-write property containing a long value that represents the error code for the last error generated.

    Rules at a Glance

    • When a runtime error is generated within the program, the error code is automatically assigned to Err.Number.

    • The Number property is updated with an application-defined error whose code is passed as an argument to the Err.Raise method.

    • When using the Err.Raise method in normal code, your user-defined error codes can't be greater than 65536 and less that 0. (For an explanation, excel vba error list, see the final note in Section 7.1.6 of the entry for the Err.Raise method.)

    • VBA error numbers in the range of 1–1000 are for its own trappable errors. In addition, error numbers from 31001 to 31037 are also used for VBA trappable errors. In implementing a series of application-defined errors, your error handlers should either translate application errors into VBA trappable errors or, preferably, assign a unique range to application-defined errors.

    • When using the Err.Raise method in ActiveX objects, add the constant. (–2147221504) to your user-defined error code to distinguish OLE errors from local application errors.

    • When control returns to the local application after an error has been raised by the OLE server, the application can determine that the error originated in the OLE server and extract the error number with a line of code like the following:

      Dim lError as Long If Err.Number And vbObjectError Then _ lError = Err.Number .

    Get VB & Excel vba error list in a Nutshell: The Language now with the O’Reilly learning platform.

    O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.

    Start your free trial

    Excel VBA Tutorial Part 10 - VBA Error Types

    VBA Error Types

    There are three types of VBA error that you may encounter when executing an Excel macro. These are:

    These three VBA error types are discussed in turn, below.


    Compile Errors

    Compile Errors are recognised by the VBA compiler as being illegal and therefore, are highlighted as errors before your macro even starts to run.

    If you type in a syntax error, the VBA editor will immediately highlight this, either by popping up a message box or by highlighting the error in red, depending on the setting of the Auto Syntax Check option (see rightabove).

    Alternatively, a compile error may be detected when the code is compiled, excel vba error list, just before being executed.


    VBA Compile Error Message Box

    A compile error is generally easy to fix, as the VBA compiler pops up a message box, which provides information on the nature of the error.

    For example, if you get the message "Compile error: Variable not defined" when you attempt to run your code, this indicates that you are referencing a variable that has not been declared in the current scope. (This error is only generated when you are using Option Explicit).


    Runtime Errors

    VBA Runtime Error Message Box

    Runtime errors occur during the execution of your code, and cause the code to stop running, excel vba error list. This type of VBA error is also usually relatively excel vba error list to fix, as you will be given details of the nature of the error, and shown the location where the code has stopped derectx vreation error example, if your code attempts to divide by zero, you will be presented with a message box, which states "Run-time error '11': Division by zero".

    Depending on the structure of your VBA project, you may be given the option to debug the code, excel vba error list, (see below). In this case, clicking on the Debug button on the debug message box, causes the line of code that generated the VBA error to be highlighted in your vba editor.

    VBA Runtime Error Message BoxVBA Runtime Error Code Debugging

    In the above example, the information provided in the message box, and the highlighted line of code, make it very easy to spot the cause of the error.

    If your code is more complex, you can gain further information on the reason for the VBA error by looking at the values of the variables in use. This can be done in the VBA editor by simply hovering your mouse cursor over the variable name, excel vba error list, or by opening the local variables window (by selecting View→Locals Window).

    The different runtime error codes are explained on the Microsoft Support Website. However, some of the more common VBA error messages are shown in the table below:


    Trapping Runtime Errors

    Some runtime errors may not be caused by faulty code. For example, if you need to open excel vba error list file, that contains essential data for your macro, you can't avoid the generation of a VBA error, if excel vba error list file does not exist. In these types of cases, it is far more professional to 'trap' the error, and write VBA code to handle it, so that your macro exits gracefully, rather than having your macro crashing.

    In order to assist with runtime error trapping, VBA provides us with the On Error and the Resume statements. These statements capture a runtime error and divert the macro into a specified section of VBA code, where the error is handled. After the error handling code has run, the programmer can request that the VBA code resumes from the point of the error, or alternatively, the macro can be terminated cleanly. This is shown in the example code below.


    Sub Set_Values(Val1 As Double, Val2 As Double)

    Dim DataWorkbook As Workbook

    On Error GoTo ErrorHandling

    Set DataWorkbook = Workbooks.Open("C:\Documents and Settings\Data")

    Val1 = Sheets("Sheet1").Cells(1, excel vba error list, 1)
    Val2 = Sheets("Sheet1").Cells(1, 2)

    DataWorkbook.Close

    Exit Sub

    ErrorHandling:

    MsgBox "Data Workbook not found;" & _
           "Please add the workbook to C:\Documents and Settings and click OK"
    Resume

    End Sub

    In the above example, the code attempts to open the Excel File 'Data' and if it fails to find the specified file, prompts the user to place the data file into the correct folder, excel vba error list. Once the user does this and clicks OK, the code is resumed and a further attempt is made to open the file. If desired, instead of re-trying the file, the Sub procedure could be terminated at this point, by using the Exit Sub command.


    Logical Errors

    Logical Errors, otherwise known as 'bugs', excel vba error list, occur during the execution of the VBA code, and allow the code to continue to run to completion. However, excel vba error list, the 'bug' may cause the macro to perform unexpected actions or return an incorrect result. These errors are the most difficult to detect and fix, excel vba error list, as there is no way that the VBA compiler can identify and 'point to' the error, in the way that it does for compile and runtime errors.

    For example, you may accidentally code your macro to add together the wrong variables in a procedure. The result would be incorrect, excel vba error list, but the macro would (usually) continue to run to completion.

    The Excel VBA editor provides a number of debugging tools to assist you in finding logical errors in excel vba error list VBA code, so that they can be fixed. These tools are currently beyond the scope of this page, excel vba error list. However, an introduction to debugging VBA is provided on the TechOnTheNet Website.

    View Excel Macro Examples
    Return to the Excel VBA Tutorial Page


    Error messages

    • Article
    • 21 minutes to read
    • A compatible ActiveX component must be a Visual Basic executable or a DLL
    • A form can't be moved or sized while minimized or maximized
    • A module is not a valid type
    • A procedure of that name already exists
    • A procedure with a ParamArray argument cannot be called with named arguments
    • A property or method call cannot include a reference to a private object (Error 98)
    • ActiveX component can't create object or return reference to this object (Error 429)
    • ActiveX component did not run correctly (Error 338)
    • ActiveX component not correctly registered (Error 336)
    • ActiveX control 'item' not found (Error 363)
    • Add-in can't reference project
    • Ambiguous name detected
    • Ambiguous selection
    • Application-defined or object-defined error
    • Argument not optional (Error 449)
    • Argument required for property Let or property Set
    • Array already dimensioned
    • Array argument must be ByRef
    • Assignment to constant not permitted
    • Automation error (Error 440)
    • Automation object doesn't have a default value (Error 443)
    • Bad DLL calling convention (Error 49)
    • Bad file mode (Error 54)
    • Bad file name or number (Error 52)
    • Bad interface for Implements: interface contains data fields
    • Bad interface for Implements: interface is derived from another pure interface with non-restricted methods
    • Bad interface for Implements: interface is not derived from Iunknown
    • Bad interface for Implements: method does not return HRESULT
    • Bad interface for Implements: method has out-only or LCID parameter
    • Bad interface for Implements: method has parameter with too many levels of indirection
    • Bad interface for Implements: method has underscore in name
    • Bad interface for Implements: methods uses type that is not supported by Visual Basic
    • Bad record length (Error 59)
    • Bad record number (Error 63)
    • Beginning of search scope has been reached; do you want to continue from the end?
    • Block If without End If
    • Breakpoint not allowed on this line
    • ByRef argument type mismatch
    • Calling convention not supported by Visual Basic
    • Cannot define a KWID_tkPUBLIC user-defined type within a private object module
    • Cannot display specified name because it is hidden
    • Cannot handle events for the object specified
    • Cannot jump to specified type because it is in the specified library, which is not currently referenced
    • Can't add a reference to the specified file
    • Can't assign or coerce array of fixed-length string or user-defined type to variant
    • Can't assign to an array
    • Can't excel vba error list Friend procedure on an object that isn't an instance of the defining class (Error 97)
    • Can't change data types of array elements
    • Can't create AutoRedraw image (Error 480)
    • Can't create necessary temporary file (Error 322)
    • Can't display hidden procedure
    • Can't display system information
    • Can't edit module
    • Can't empty Clipboard (Error 520)
    • Can't enter break mode at this time
    • Can't execute code in break mode
    • Can't execute immediate statements in design mode
    • Can't exit design mode because control can't be created
    • Can't find DLL entry point in specified DLL
    • Can't find project or library
    • Can't find Windows Help .exe file
    • Can't Get or Put user-defined type containing object reference
    • Can't have paramarrays with optional arguments
    • Can't load module; invalid format
    • Can't load or unload this object (Error 361)
    • Can't make an assignment to a read-only property
    • Can't open Clipboard (Error 521)
    • Can't perform operation because the project is protected
    • Can't perform requested operation (Error 17)
    • Can't perform requested operation since the module is hidden
    • Can't place conditional breakpoint on an array
    • Can't print form image to this type of printer (Error 486)
    • Can't print minimized form image
    • Can't quit at this time
    • Can't record into running module
    • Can't ReDim, Erase, or assign to variant that contains array whose element is with object
    • Can't remove control or reference; in use
    • Can't remove default reference
    • Can't rename with different drive (Error 74)
    • Can't save file to TEMP directory (Error 735)
    • Can't set the project name at this time
    • Can't show non-modal form when modal form is displayed
    • Can't sink this object's events because it's already firing events to the maximum number of supported event recipients (Error 96)
    • Can't start new recording until current session is ended
    • Can't use character device names in file names: 'item' (Error 320)
    • Case Else outside Select Case
    • Case without Select Case
    • Circular dependencies between modules
    • Class doesn't support Automation (Error 430)
    • Class is not set (Error excel vba error list not registered on local machine (Error 463)
    • Class not registered. 'item 1'
    • Code execution has been interrupted
    • Code resource lock error (Error 455)
    • Code resource not found (Error 454)
    • Compile error in hidden module:
    • Component could not successfully create requested object
    • Component 'item' or one of its dependencies not correctly registered: a file is missing or invalid
    • Component not correctly registered
    • Component not found in registered location
    • Conflicting attributes were found in 'item'. The defaults will be used
    • Conflicting names were found in 'item1'. The name 'item2' will be used
    • Connection to type library or object library for remote process has been lost (Error 442)
    • Constant expression required
    • Constants, fixed-length strings, arrays, user-defined types, and Declare statements not allowed as Public members of an object module
    • Could not access system registry (Error 335)
    • Could not create reference: 'item'
    • Could not execute specified program
    • Could not start Internet Explorer
    • Current module does not support Print method
    • Cyclic reference of projects not allowed
    • Data types displayed in Locals Window
    • Data value named not found (Error 327)
    • Definitions of property procedures for the same property are inconsistent
    • Deftype statements must precede declarations
    • Destination label too far away; loop, Select Case, or block if too large
    • Device I/O error (Error 57)
    • Device unavailable (Error 68)
    • Disk full (Error 61)
    • Disk not ready (Error 71)
    • Display more load errors?
    • Division by zero (Error 11)
    • Do without Loop
    • Do you want to export specified object before removing it?
    • Duplicate declaration in current scope
    • Duplicate definition
    • Duplicate Deftype statement
    • Duplicate Option statement
    • Duplicate procedure name
    • Duplicate resources with same type and name
    • Edit can't be undone--proceed anyway?
    • #Else clause must be preceded by a matching #If
    • #Else If, excel vba error list, #Else, or #End If must be preceded by a matching #If
    • #Else without #If
    • #ElseIf must be preceded by a matching #If or #ElseIf and followed by an #ElseIf, #Else, or #End If
    • Empty Enum type not allowed
    • Empty watch expression
    • End If without block If
    • End of search scope has been reached; do you want to continue from the beginning?
    • End Select without Select Case
    • End with without with
    • Enum types defined in standard modules or private classes cannot be used in public object modules as parameters or return types for public procedures, as public data members, or as fields of public user defined types
    • Error accessing the system registry
    • Error in loading DLL (Error 48)
    • Error loading from file (Error 31037)
    • Error loading 'item'. A control could not be loaded due to load error. Continue?
    • Error loading 'item'. An error was encountered loading a property. Continue?
    • Error saving to file (Error 31036)
    • Errors during load. Refer to 'item' for details
    • Errors occurred during load
    • Event handler is invalid
    • Event not found
    • Exit Do not within Do.Loop
    • Exit For not within For.Next
    • Exit function not allowed in sub or property
    • Exit property not allowed in function or sub
    • Exit Sub not allowed in function or property
    • Expected array
    • Expected End function
    • Expected End property
    • Expected End Sub
    • Expected End With
    • Expected function or variable
    • Expected procedure, not module
    • Expected procedure, not project or library
    • Expected procedure, not user-defined type
    • Expected procedure, not variable
    • Expected sub, excel vba error list, function, or property
    • Expected user-defined type, not project
    • Expected variable or procedure, not Error 8 calling mapviewoffile type
    • Expected variable or procedure, not module
    • Expected variable or procedure, excel vba error list project
    • Expected: error
    • Expression too complex (Error 16)
    • External name not defined
    • Failed to activate control 'item 1'. This control may be incompatible with your application. Make sure you are using the version of the control that was provided with your application
    • Failed to load control 'item1' from 'item2'. your version of 'item2' may be outdated. Make sure you are using the version of the control that was provided with your application
    • File already exists (Error 58)
    • File already open (Error 55)
    • File format no longer supported
    • File is read-only
    • File not found (Error 53)
    • File specified was not found
    • Filename or class name not found during Automation operation (Error 432)
    • Fixed or static data can't be larger than 64K
    • Fixed-length strings and use of the 'new' qualifier are not allowed for fields in a public user defined type defined in an object module
    • Fixed-length strings not allowed as the type of a public essbase error code 1012704 of an object module; private object modules not allowed as the type of a public member of a public object module
    • For control variable already in use
    • For Each can only iterate over a collection object or an array
    • For Each control variable must be variant or object
    • For Each control variable on arrays must be variant
    • For Each may not be used on array of user-defined type or fixed-length strings
    • For loop not initialized (Error 92)
    • For without Next
    • Form already displayed; can't show modally (Error 400)
    • Form not found (Error 424)
    • Forward reference to user-defined type
    • Function call on left-hand side of assignment must return variant or object
    • Function marked as restricted or uses a type not supported in Visual Basic
    • Identifier too long
    • Identifier under cursor isn't a procedure name
    • Illegal parameter. Can't write arrays (Error 328)
    • Illegal parameter. Can't write object because it does not support persistence
    • Illegal parameter. Can't write user-defined type
    • Incorrect DLL version
    • Incorrect OLE version
    • Input past end of file (Error 62)
    • Insufficient Immediate window memory to create variable
    • Insufficient memory to save Undo information
    • Insufficient project information to load project on platform or with version now being used
    • Interface not valid for Implements
    • Internal error (Error 51)
    • Invalid Access mode
    • Invalid attribute in sub, function, or property
    • Invalid Base address
    • Invalid character
    • Invalid Clipboard format (Error 460) [1 of 2]
    • Invalid Clipboard format (Error 460) [2 of 2]
    • Invalid data format
    • Invalid data type for constant
    • Invalid event name
    • Invalid file format (Error 321) [1 of 2]
    • Invalid file format (Error 321) [2 of 2]
    • Invalid format in resource file (Error 325)
    • Invalid in Immediate window
    • Invalid inside Enum
    • Invalid inside procedure
    • Invalid length for fixed-length string
    • Invalid Next control variable reference
    • Invalid object use (Error 425)
    • Invalid optional parameter type
    • Invalid or unqualified reference
    • Invalid ordinal (Error 452)
    • Invalid outside Enum
    • Invalid outside procedure
    • Invalid ParamArray use
    • Invalid pattern string (Error 93)
    • Invalid picture (Error 481) [1 of 2]
    • Invalid picture (Error 481) [2 of 2]
    • Invalid picture type (Error 485)
    • Invalid procedure call or argument (Error 5)
    • Invalid procedure name
    • Invalid property name
    • Invalid property value (Error 380) [1 of 2]
    • Invalid property value (Error 380) [2 of 2]
    • Invalid property-array index (Error 381)
    • Invalid qualifier
    • Invalid ReDim
    • Invalid syntax for conditional compiler constant declarations
    • Invalid Template
    • Invalid type-declaration character
    • Invalid use of AddressOf operator
    • Invalid use of base class name
    • Invalid use of Me keyword
    • Invalid use of new keyword
    • Invalid use of Null (Error 94)
    • Invalid use of object
    • Invalid watch expression
    • Item already exists in project
    • Item cannot be added because it is referenced but not in use by any items in the project. To correct this, uncheck 'Remove information about unused ActiveX Controls' in Project options
    • Item could not be loaded, excel vba error list. Remove it from the list of available add-ins?
    • Item could not be loaded
    • Item could not be registered
    • Item designers can only be used in DLL projects
    • Item designers cannot be private
    • Item designers cannot be public in ActiveX EXE projects
    • Item designers must be public and cannot be used in Standard EXE projects
    • Item has an old file format. When saved, it will be saved in a newer format
    • Item has caused an access violation. Remove it from the list of available Add-Ins?
    • Item is a binary form and can't be loaded into Visual Basic
    • Item is a read-only file
    • Item is a single-threaded component and cannot be used in multi-threaded projects
    • Item is not a valid control type (Error 720)
    • Item property can't be read at run time (Error 393)
    • Item property can't be set at run time (Error 382)
    • Item property is read-only (Error 383)
    • Item property is write-only (Error 394)
    • Item will not be loaded. Name is already in use
    • 'item1' is an invalid key. The file 'item2' can't be loaded
    • 'item1' is referenced by 'item2' project and cannot be updated
    • Keyword not found
    • Label not defined
    • Language/region setting has changed
    • License information for this component not found. You don't have an appropriate license to use this functionality in the design environment (Error 429)
    • Line isn't an executable statement
    • Line 'item1': All controls must precede menus; can't load control 'item2'
    • Line 'item1': Can't create embedded object in 'item2'; license not found
    • Line 'item1': Can't create embedded object in 'item2'
    • Line 'item1': Can't load control 'item2'; containing control not a valid container
    • Line 'item1': Can't load control 'item2'; license not found
    • Line 'item1': Can't load control 'item2'; name already in use
    • Line 'item1': Can't set checked property in menu 'item2'. Parent menu can't be checked
    • Line 'item1': Can't set Shortcut property in menu mangust phone read error. Parent menu cannot have a shortcut key
    • Line 'item1': Class 'item2' of control 'item3' was not a loaded control class
    • Line 'item1': Class name too long; truncated to 'item2'
    • Line 'item1': control name too long; truncated to 'item2'
    • Line 'item1': Could not create reference: 'item2'
    • Line 'item1': Did not find an index property, and control 'item2' already exists
    • Line 'item1': 'item2' has a quoted string where the property excel vba error list should be
    • Line 'item1': Maximum nesting level for controls exceeded with 'item2'
    • Line 'item1': Missing or invalid control class in file 'item2 '
    • Line 'item1': Missing or invalid control name in file 'item2'
    • Line 'item1': Parent menu 'item2' can't be loaded as a separator
    • Line 'item1': property 'item2' in control 'item3' had an invalid property index
    • Line 'item1': property 'item2' in 'item3' could not be loaded
    • Line 'item1': property 'item2' in 'item3' could not be set
    • Line 'item1': property 'item2' in 'item3' had an invalid file reference
    • Line 'item1': property 'item2' in 'item3' had an invalid value
    • Line 'item1': property 'item2' in 'item3' must be a quoted string
    • Line 'item1': Syntax error: property 'item2' in 'item3' was missing an equal sign (=)
    • Line 'item1': The CLSID 'item2' for 'item3' is invalid
    • Line 'item1': The control name 'item2' is invalid
    • Line 'item1': The file 'item2' could not be loaded
    • Line 'item1': The form or MDIForm name 'item2' is already in use; can't load this form
    • Line 'item1': The form or MDIForm name 'item2' is not valid; can't load this form
    • Line 'item1': The property name 'item2' in 'item3' is invalid
    • Line too long
    • Loop without Do
    • LSet allowed only on strings and user-defined types
    • LSet not allowed
    • Margin indicators
    • Maximum number of watch expressions added
    • MDI forms are not allowed in multithreaded projects. Any MDI form will be removed from this project. To keep the MDI form in the project select Cancel and change threading model to Thread Pool with only 1 thread
    • Member identifier already exists in object module from which this object module derives
    • Method not valid without suitable object
    • Method or data member not found (Error 461)
    • Missing end bracket
    • Module not found
    • Module too excel vba error list be first statement on the line
    • Must close or hide topmost modal form first (Error 402)
    • Must specify which item(s) to print
    • Name conflicts with existing module, project, or object library
    • Name 'item' conflicts with existing module, project, excel vba error list, or object library
    • Named argument already specified
    • Named argument not found (Error 448)
    • Named arguments not allowed
    • Need property-array index (Error 385)
    • Next without For
    • No creatable public component detected. Press F1 for more information
    • No Help available
    • No object (Error 31004)
    • No text selected
    • No watch expression selected
    • Not a legal object name: 'item
    • Not enough memory to completely save project
    • Not enough memory to load file
    • Not enough memory to run; quitting
    • Object already excel vba error list (Error 360)
    • Object does not have a property Let procedure
    • Object does not source Automation events
    • Object doesn't support current locale setting (Error 447)
    • Object doesn't support named arguments (Error 446)
    • Object doesn't support this action (Error 445)
    • Object doesn't support this property or method (Error 438)
    • Object library feature not supported
    • Object library for Visual Basic for Applications not found
    • Object library invalid or contains references to object definitions that could not be found
    • Object library not registered
    • Object library's language setting incompatible with current project
    • Object module must implement all procedures in interface
    • Object required (Error 424)
    • Object server not found (Error 337)
    • Object variable not set (Error 91)
    • Object was unloaded (Error 364)
    • One or more files in the project have changed. Do you want to save the changes now?
    • One or more instances excel vba error list this object are running. Can't remove it at this time
    • One or more of the properties in 'item' was bad. Some or all of the properties might not be set correctly
    • Only comments may appear after End Sub, End Function, or End Property
    • Only public user defined types defined in public object modules can be used as parameters or return types for public procedures of class modules or as fields of public user defined types
    • Only valid in object module
    • Operation not allowed in DLL
    • Option Private module not permitted in object module
    • Optional argument must be variant
    • Other applications are currently accessing an object in your program. Ending the program now could cause errors in those programs. End program at this time?
    • Out of memory (Error 31001)
    • Out of memory (Error 7)
    • Out of memory; some watches might have been deleted
    • Out of resources
    • Out of stack space (Error 28)
    • Out of string space (Error excel vba error list (Error 6)
    • ParamArray must be declared as an array of variant
    • Path not found (Error 76)
    • Path/File access error (Error 75)
    • Permission denied (Error 70)
    • Permission to use object denied (Error 419)
    • Please see the Readme file for more information on this error
    • Printer driver does not support specified property (Error 483)
    • Printer error (Error 482) [1 of 2]
    • Printer error (Error 482) [2 of 2]
    • Private Enum and user-defined types cannot be used as parameters or return types for public procedures, public data members, or fields of public user-defined types
    • Private object modules cannot be used in public object modules as parameters or return types for public procedures, as public data members, or as fields of public user defined types
    • Problem getting printer information from the system; make sure the printer is set up correctly. (Error 484)
    • Procedure declaration does not match description of event or procedure having same name
    • Procedure too large
    • Procedure type mismatch
    • Programmatic ID string too long 'item'. The Programmatic ID must be 39 characters or less
    • Project contains too many procedure, variable, and constant names
    • Project file is read-only
    • Project has been modified. Do you wish to save the changes now?
    • Project is unviewable
    • Project not found
    • Property Get can't be executed at run time (Error 393)
    • Property Get can't be executed on write-only property (Error 394)
    • Property Let procedure excel vba error list defined and property get procedure did not return an object (Error 451)
    • Property not found (Error 422)
    • Property or method not found (Error 423)
    • Property Set can't be executed at run time (Error 382)
    • Property Set can't be used with a read-only property (Error 383)
    • Property Set not permitted (Error 387)
    • Qualified name disallowed in module scope
    • Qualifier must be collection
    • Range has no values
    • Replacements too long (Error 746)
    • Requested type library or wizard is not a VBA project
    • Resume without error (Error 20)
    • Return without GoSub (Error 3)
    • RSet allowed only on strings
    • Run-time error :
    • Search string must be specified (VBE)
    • Search string must be specified
    • Search string too long or excel vba error list text isn't found
    • Search text not found (Error 744)
    • Seek failed: can't read/write from the disk
    • Select Case without End Select
    • Selected watch expression invalid
    • Set Next statement can only apply to executable lines within current procedure
    • SHARE.EXE required
    • Specified ActiveX component not correctly registered or not found
    • Specified DLL function not found (Error 453)
    • Specified format doesn't match format of data (Error 461)
    • Specified library or project already referenced
    • Statement invalid inside Type block
    • Statement invalid outside Type block
    • Statement too complex
    • Statements or labels invalid between Select Case and first Case
    • String value too long to process; form load aborted
    • Sub, excel vba error list, function, or property not defined (Error 35)
    • Subscript out of range (Error 9)
    • Syntax error
    • System DLL 'dll' could not be loaded (Error 298)
    • System error 'item'
    • The .VBP file for this project contains an invalid or corrupt library references ID
    • The ActiveX Designer's Type information does not match what was saved. Unable to Load
    • The application description can't be more than 2000 characters long
    • The binary compatibility DLL or EXE contains a parameter excel vba error list or return type whose definition cannot be found
    • The binary compatibility DLL or EXE contains an Implements type whose definition cannot be found
    • The code in this project must be updated for use on 64-bit systems
    • The current project does not support files of this type
    • The edit may make the object module incompatible with the previously specified compatible ActiveX component
    • The file 'item' is marked as a version not supported by the current version of Visual Basic and won't be loaded
    • The file 'item' is out of date. This program requires a later version (Error 368)
    • The file 'item' was not registerable as an ActiveX Component
    • The form class contained in the specified file is not supported in Visual Basic for Applications; the file can't be loaded
    • The library containing this symbol is not referenced by the current project, so the symbol is undefined. Would you like to add a reference to the containing library now?
    • The load behavior for 'item' could not be updated because of current registry excel vba error list project file 'item' is corrupt and can't be loaded
    • The project file 'item1' contains invalid 'item2' key value. Valid range is 0 to 'item3'
    • The project file 'item1' contains invalid 'item2' key value
    • The project file 'item1' contains invalid key 'item2'. The project can't be loaded
    • The project file 'item1' contains invalid key 'item2'
    • The project name is too long. Name has been truncated
    • The remote server machine does not exist or is unavailable (Error 462)
    • The selected Add-In has not been confirmed to be 'Command Line Safe,' and may require some user intervention (possible UI)
    • The specified file could not be loaded
    • The specified object can't be used as an owner form for show() (Error 371)
    • The specified region has been searched and 1 replacement was made
    • The specified region has been searched and the replacements were made
    • The specified region has been searched
    • This action will reset your project, proceed anyway?
    • This array is fixed or temporarily locked (Error 10)
    • This command will stop the debugger
    • This component doesn't raise any events
    • This component doesn't support this set of events (Error 459)
    • This control can only be used with 'item' designers
    • This control cannot be used with 'item' designers
    • This designer cannot be used because it uses features that are not supported in this version of Visual Basic
    • This document was opened with macros disabled
    • This edit requires a Reset
    • This excel vba error list requires Internet Explorer 'item' or greater. You can obtain the latest version from www.microsoft.com
    • This interaction between compiled and design environment components is not supported
    • This key is already associated with an element of this collection (Error 457)
    • This project is currently referenced by another project and cannot be closed
    • This VBA project was created while running VBA in a different application. You may only open it from inside the same application in which it was created
    • Too many arguments
    • Too many dimensions
    • Too many DLL application clients
    • Too many files (Error 67)
    • Too many line continuations
    • Too smtp error 575 local, nonstatic variables
    • Too many module-level variables
    • Translation failed. Please check the trnslate.log file for more information
    • Trappable errors
    • Type mismatch (Error 13)
    • Type mismatch: array or user-defined type expected
    • Type not supported in Visual Basic
    • Type-declaration character does not match declared data type
    • Type-declaration character not allowed
    • Type-declaration character required
    • Unable to activate object (Error 31027)
    • Unable to create embedded object (Error 31032)
    • Unable to display Help
    • Unable to read from the disk
    • Unable to unload within this context (Error 365)
    • Unable to write Designer cache file 'item'; will just use regular files on Load
    • Unable to write to the disk
    • Unexpected compile error
    • Unexpected error occurred in code generator or linker
    • Unexpected error; please contact Microsoft Technical Support
    • Unexpected error; quitting
    • Unexpected error
    • Unmatched brackets in search string
    • Unrecognized project language
    • User interrupt occurred (Error 18)
    • User-defined type may not be passed ByVal
    • User-defined type not defined
    • User-defined type without members not allowed
    • Valid values are whole numbers from 1 to 32
    • Valid values are whole numbers from 2 to 60
    • Variable not defined
    • Variable not yet created in this context
    • Variable required. Can't assign to this expression
    • Variable uses a type not supported in Visual Basic (Error 458)
    • Version number missing or invalid; Visual Basic 5.0 assumed
    • Version numbers must be in the range 0 to 9999
    • Warning: custom language settings not portable
    • Wend without While
    • While without Wend
    • Windowless controls can't have menus
    • With object must be user-defined type, object, or variant
    • Wizards can't reference projects
    • Wrong number of arguments (Error 450)
    • Wrong number of dimensions
    • Wrong version of operating system; requires Windows NT 3.51 (build 'item1' or later) or Windows 95 (build 'item2' or later)
    • You must save a project before you can reference it
    • You must terminate the If block with an End If

    See also

    Support and feedback

    Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.

    Appendix B: VBA Error Codes

    This appendix contains a complete listing of the error codes for all trappable errors in Visual Basic for Applications (VBA). This information is useful for error trapping. For complete details, consult Excel's Help system.

    Error Code

    Message

    3

    Return without GoSub.

    5

    Invalid procedure call or argument.

    6

    Overflow (for example, excel vba error list, value too large for an integer).

    7

    Out of memory. This error rarely refers to the amount of physical memory installed on your system. Rather, excel vba error list, it usually refers to a fixed-size area of memory used by Excel or Windows (for example, excel vba error list, the area used for graphics or custom formats).

    9

    Subscript out of range. You will also get this error message if a named item is not found in a collection of objects, excel vba error list. For example, excel vba error list, if your code refers to Sheets(“Sheet2”), and Sheet2 does not exist.

    10

    This array is fixed or temporarily locked.

    11

    Division by zero.

    13

    Type mismatch.

    14

    Out of string space.

    16

    Expression too complex.

    17

    Can't perform requested operation.

    18

    User interrupt occurred. This error occurs if the user interrupts a macro by pressing the Cancel key.

    20

    Resume without error. This error probably indicates that you forgot the Exit Sub statement before your error handler code.

    28

    Out of stack space.

    35

    Sub or Function not defined.

    47

    Too many Dynamic Link Library (DLL) application clients.

    48

    Error in loading DLL.

    49

    Get Excel 2013 Power Programming with VBA now with the O’Reilly learning platform.

    O’Reilly members experience live online training, plus books, excel vba error list, videos, and digital content from nearly 200 publishers.

    Start your free trial

    List of Runtime Error Codes

  • 05-23-2007, 05:20 PM#1

    DCSwearingen is offline
    Forum Contributor

    List of Runtime Error Codes

    I thought I had seen a VBA routine that would return a listing of the VBA Runtime error codes and what they mean.

    I know I have seen such a routine in Access97 VBA, but am not sure it will work in Excel.

    I am not sure this is even possible, but if it is would it be possible to post the code that will return a list of the codes and what they mean?

    If it isn't possible, please let me know that as well.

    One more thing.
    This is not a cross post, as I had posed a similar question in the Miscellaneous Forum, but I deleted that post as I realized it was in the wrong forum.
    Thanks!
    Dennis

    I am using Windows 7 and Office 2007, all of my posts are based on this.

  • 05-23-2007, 05:44 PM#2


  • 05-24-2007, 08:47 AM#3

    DCSwearingen is offline
    Forum Contributor

    Thank You!

    This is the list I was looking for.

    For some reason I thought there was a VBA routine that would return the list to an Excel sheet, but this works for me!!

  • 08-21-2013, 09:13 PM#4

    MSC_GG is offline
    Registered User

    Lightbulb Macro to get the list of runtime errors

    Hello,
    Sorry to unearth this old thread.

    QuoteOriginally Posted by DCSwearingenView Post

    For some reason Critical error were found in setup cs3 thought there was a VBA routine that would return the list to an Excel sheet

    Indeed there is a way in Excel to programmatically retrieve a listing of all VBA built-in runtime errors that are available on your platform. For example, excel vba error list, you can paste the code below in a module of an empty workbook (successfully tested in Excel 2007).

    Note that I parse error codes from 1 to 1000 (see variable MaxErrNo): that’s because, in my Excel 2007, the highest built-in error code is 746. But you can actually parse the error codes up to 65535 (see the link already posted by VBA Noob), it will just take longer to execute the macro.

    Of course this could be improved by handling unexpected errors, adding a button on the 1st worksheet, displaying progress, excel vba error list, storing the error codes and descriptions in a Dictionary object, etc.

    Last edited by MSC_GG; 08-21-2013 at 09:15 PM, excel vba error list. Reason: Changed the title


  • 0 Comments

    Leave a Comment