I am working on a project that could have several people writing code for it at once. As part of the kickoff we are putting together coding guidelines so we all work in roughly the same manner and can maintain each other's code with minimal effort.
To that end we are creating a "Template" module to use as a pattern and that is what I would like feedback on:
[vba]'-------------------------------------------------------------------------------
' Copyright : ©2/16/2009 Aaron Bush
' Module Purpose : This module is to provide a template for new modules.
' Module Dependancies : mdlErrorHandler
' Module References :
' - Visual Basic For Applications
' C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL
'-------------------------------------------------------------------------------
' Revisions:
' Version 1.00 Aaron Bush 2/16/2009
' Creation.
'-------------------------------------------------------------------------------

'--------------------- Module Options ---------------------
'Reminder: If you remove or alter these default options be sure to document why.
Option Compare Binary
Option Explicit
Option Base 0
Option Private Module
'--------------------- Compiler Constants ---------------------
#Const ccDebugMode = -1
'--------------------- Constants ---------------------
Private Const m_strModuleName_c As String = "mdlTemplate"
'--------------------- Enums ---------------------
'******************************
'>>>>>>> Your Enums Here<<<<<<<
'******************************
'--------------------- User Defined Types ---------------------
'******************************
'>>>>>>> Your UDTS Here <<<<<<<
'******************************

'--------------------- Module Level Variables ---------------------
'***************************************************
'>>>>>>> Your Module Level Variables Go Here <<<<<<<
'***************************************************

'--------------------- API Calls ---------------------
'********************************************
'>>>>>>> Your API Calls Go Here <<<<<<<
'********************************************
'--------------------- Properties ---------------------
'********************************************
'>>>>>>> Your Properties Go Here <<<<<<<
'********************************************
'--------------------- Events ---------------------
'*************************************
'>>>>>>> Your Events Go Here <<<<<<<
'*************************************

'--------------------- Subs/Functions ---------------------
Public Function FunctionTemplate(ByVal myValue As String) As String
'---------------------------------------------------------------------------
' Original Author :
' Date of Creation :
'---------------------------------------------------------------------------
' Purpose :
' Input(s) :
' Output(s) :
' Revisions :
'---------------------------------------------------------------------------
Const strProcedureName_c As String = "FunctionTemplate"
Dim strRtnVal As String
#If Not ccDebugMode Then
On Error GoTo Err_Hnd
#End If
'*******{Procedure Body}*******
'>>>>>>> Your Code Here <<<<<<<
'******************************
Exit_Proc:
On Error Resume Next
'Set Return Value:
'Release Object/Arrays:
'Restore Application State:
#If Not ccDebugMode Then
Exit Function
Err_Hnd:
'Load error'd return value into return value variable.
mdlErrorHandler.FormattedErrorMessage strProcedureName_c, m_strModuleName_c, _
Err.Description, Err.Source, Err.Number
Resume Exit_Proc
#End If
End Function
Public Sub SubTemplate(ByVal myValue As String)
'---------------------------------------------------------------------------
' Original Author :
' Date of Creation :
'---------------------------------------------------------------------------
' Purpose :
' Input(s) :
' Output(s) : N/A
' Revisions :
'---------------------------------------------------------------------------
Const strProcedureName_c As String = "SubTemplate"
#If Not ccDebugMode Then
On Error GoTo Err_Hnd
#End If
'*******{Procedure Body}*******
'>>>>>>> Your Code Here <<<<<<<
'******************************
Exit_Proc:
On Error Resume Next
'Release Object/Arrays:
'Restore Application State:
#If Not ccDebugMode Then
Exit Sub
Err_Hnd:
mdlErrorHandler.FormattedErrorMessage strProcedureName_c, m_strModuleName_c, _
Err.Description, Err.Source, Err.Number
Resume Exit_Proc
#End If
End Sub
[/vba]