Advertisement
msfz751

MGlobals

May 19th, 2014
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '
  2. ' Description:  This module holds declarations for global constants,
  3. '               variables, type structures, and DLLs.
  4. '
  5. ' Authors:      Rob Bovey, www.appspro.com
  6. '               Stephen Bullen, www.oaltd.co.uk
  7. '
  8. ' Chapter Change Overview
  9. ' Ch#   Comment
  10. ' --------------------------------------------------------------
  11. ' 05    Initial version
  12. '
  13. Option Explicit
  14. Option Private Module
  15.  
  16. ' **************************************************************
  17. ' Global Constant Declarations Follow
  18. ' **************************************************************
  19. ' Application identification constants.
  20. Public Const gsAPP_NAME As String = "PETRAS Time Sheet"     ' Name of the application.
  21. Public Const gsVERSION As String = "1.0"                    ' Application version number.
  22. Public Const gsBUILD As String = ".003"                     ' Application build number.
  23.  
  24. ' CommandBar name constants.
  25. Public Const gsBAR_TOOLBAR As String = "PETRAS Toolbar"
  26.  
  27. ' Filename constants.
  28. Public Const gsFILE_TIME_ENTRY As String = "PetrasTemplate.xls"
  29.  
  30. ' PetrasTemplate.xls worksheet CodeName constants.
  31. Public Const gsSHEET_TIME_ENTRY As String = "wksTimeEntry"
  32.  
  33. ' ThisWorkbook wksUISettings range name constants.
  34. Public Const gsRNG_NAME_LIST As String = "tblRangeNames"
  35.  
  36. ' PetrasTemplate.xls wksTimeEntry range name constants.
  37. Public Const gsRNG_SET_HIDE_COLS As String = "setHideCols"
  38. Public Const gsRNG_SET_SCROLL_AREA As String = "setScrollArea"
  39. Public Const gsRNG_HAS_ERRORS As String = "errHasErrors"
  40. Public Const gsRNG_INSERT_ROW As String = "ptrInsertRow"
  41. Public Const gsRNG_EMPLOYEE_NAME As String = "inpEmployee"
  42. Public Const gsRNG_WEEK_END_DATE As String = "inpWeekEnding"
  43.  
  44. ' Error message constants.
  45. Public Const gsERR_FILE_NOT_FOUND As String = "The PetrasTemplate.xls workbook could not be located."
  46. Public Const gsERR_DATA_ENTRY As String = "There are data entry errors on the time sheet. Please fix them before posting it."
  47.  
  48. ' User message constants.
  49. Public Const gsMSG_BOOK_NOT_ACTIVE As String = "The PetrasTemplate.xls workbook must be active before this command can be used."
  50. Public Const gsMSG_POST_SUCCESS As String = "The time entry workbook was successfully posted."
  51. Public Const gsMSG_POST_FAIL As String = "The time entry workbook could not be posted."
  52.  
  53. ' Status bar constants.
  54. Public Const gsSTATUS_LOADING_APP As String = "Loading application, please wait..."
  55.  
  56. ' Dialog caption constants.
  57. Public Const gsCAPTION_SELECT_FOLDER As String = "Select Your Consolidation Folder"
  58.  
  59. ' Registry setting constants.
  60. Public Const gsREG_APP As String = "Professional Excel Development\Petras Reporting"
  61. Public Const gsREG_SECTION As String = "Settings"
  62. Public Const gsREG_KEY As String = "ConsolidationPath"
  63.  
  64.  
  65. ' **************************************************************
  66. ' Global Variable Declarations Follow
  67. ' **************************************************************
  68. Public gbShutdownInProgress As Boolean     ' Used to ensure that the app shutdown code doesn't get called more than once.
  69. Public gsAppDir As String                  ' Application directory
  70.  
  71.  
  72. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  73. ' Comments:   This routine initializes all global variables.
  74. '
  75. ' Arguments:    None
  76. '
  77. ' Date          Developer       Chap    Action
  78. ' --------------------------------------------------------------
  79. ' 06/01/08      Rob Bovey       Ch05    Initial version
  80. '
  81. Public Sub InitGlobals()
  82.  
  83.     ' Get the application directory.
  84.    gsAppDir = ThisWorkbook.Path
  85.     If Right$(gsAppDir, 1) <> "\" Then gsAppDir = gsAppDir & "\"
  86.    
  87.     ' Initialize global variables.
  88.    gbShutdownInProgress = False
  89.    
  90. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement