Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've written some code in Excel and I'm developing the Error Handling
portion of it. I've written a small subroutine that will generate (or append to) an error log so that I can track any errors that I might get. What I've done (and tested) is create the following subroutine ' ' ' Sub ErrLog (strModule as String, intError as Integer, strDesc as String) Dim strOutput as String strOutput = "An error was report from Module - " & strModule & ". The error is " & intError & " " & strDesc Open "C:\ErrorLog.txt" for Append as #1 Write #1, strOutput Close #1 End Sub The variables that I'm passing it are strModule (which is the name of the subroutine that the error occurred) intError (which is the actual error number) strDesc (which is the error's description) I'm using the standard error trapping routine... Sub Proc1( ) On Error GoTo Proc1Error Proc1Error_Exit: Exit Sub Proc1Error: ErrLog ("Proc1", Err.Number, Err.Description) Resume Proc1Error_Exit End Sub I'm getting an error message indicating that it's expecting an "=". If I modify the ErrLog subroutine so that it only accepts the strModule variable and I eliminate the Err.Number and Err.Description from the line that calls ErrLog, everything works as I want it to. Can I not pass Err.Number or Description to another subroutine? Thanks. Jeff |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing Arguments in Excell | Excel Worksheet Functions | |||
Passing Arguments in Excell function | Excel Discussion (Misc queries) | |||
Passing Variable Number of Arguments to a Sub | Excel Discussion (Misc queries) | |||
Passing ARGUMENTS between event procedures of a USERFORM | Excel Programming | |||
Question: Macro overloading, passing variable number of arguments | Excel Programming |