Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a VBA add-in that I've created for Excel. There is a user form. The
add-in creates a command button on the Standard toolbar that, when clicked, causes the userform to display. The add-in compiles and installs without error, and adds the button to the toolbar as expected. However when clicking the button, Excel crashes with no warning or dialog box. I need to find out what I'm doing that is causing the userform to cause Excel to crash. I'm wondering if its related to not having a fully qualified object or something like that. Any help would be appreciated. Here's the code that invokes the user form. It is in a module called modStartForm: ================================================== == Public Sub ShowUFMain() On Error GoTo ErrorRoutine ufMain.Show ErrorRoutine: modErrorHandle.ErrorHandling "modStartform.ShowUFMain" End Sub ================================================== == There is some code relating to the invocation of the user form that is associated with the user form itself. The userform is called ufMain. Here is the relevant code: ================================================== == Private Sub UserForm_Activate() On Error GoTo ErrorRoutine 'Populate the Project Name If ActiveSheet.PageSetup.CenterHeader = "" Then For mRow = 1 To 20 For mCol = 1 To 20 If Left(Cells(mRow, mCol), 8) = "PROJECT:" Then ufMain.pg1ProjTitle_txt = Mid(Cells(mRow, mCol), 11) Next Next Else ufMain.pg1ProjTitle_txt = ActiveSheet.PageSetup.CenterHeader End If ErrorRoutine: modErrorHandle.ErrorHandling "ufMain.UserForm_Activate" End Sub ================================================== == Private Sub UserForm_Initialize() On Error GoTo ErrorRoutine Dim mCount, mRow, mCol As Integer ''''''''''''''''''''''''''''''''' 'Really, all this sub does is to populate the form with values ''''''''''''''''''''''''''''''''' 'Page 1 'Populate the various combo boxes If ufMain.pg1ColorCompletedColor_ddl.ListCount = 0 Then For mCount = 1 To 9 ufMain.pg1ColorCompletedColor_ddl.AddItem ufMain.pg1ColorMSColor_ddl.AddItem ufMain.pg1ColorParentColor_ddl.AddItem ufMain.pg1ColorStartDateColor_ddl.AddItem Next mCount End If 'Populate rows you just created With ufMain.pg1ColorCompletedColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With With ufMain.pg1ColorMSColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With With ufMain.pg1ColorParentColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With With ufMain.pg1ColorStartDateColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With 'Initialize Reporting Period txtboxes If ufMain.pg2ReportingMonth_txt = "" Then ufMain.pg2ReportingMonth_txt = Month(Date) - 1 If ufMain.pg2ReportingYear_txt = "" Then ufMain.pg2ReportingYear_txt = Year(Date) 'Initialize form fields from HKEY_CURRENT_USER registry 'First, check to see if hive keys exist, and if not, then create it ' and populate it with default values If RegistryKeyExists(mBaseKey, mKeyName) = False Then InitializeRegistryHive 'Now, copy values from registry into form fields LoadRegistryValuesIntoFormPage1 LoadRegistryValuesIntoFormPage2 LoadRegistryValuesIntoFormPage3 LoadRegistryValuesIntoFormPage4 'Load the Pg1 Template Combo Boxes LoadPg1TemplateComboBoxes '''''''''''''''''''''''' 'Add code to goto the Project Title control on page 1 '''''''''''''''''''''''''' 'ufMain.MultiPage1.Pages ("Page1") 'Me.txtProjTitle.SetFocus ErrorRoutine: modErrorHandle.ErrorHandling "ufMain.userform_Initialize" End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() modErrorHandle is run every time in each sub. I don't believe that is actually what you want. Add "Exit Sub" as a separate line just before the "ErrorRoutine:" line. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "Stu W" wrote in message I have a VBA add-in that I've created for Excel. There is a user form. The add-in creates a command button on the Standard toolbar that, when clicked, causes the userform to display. The add-in compiles and installs without error, and adds the button to the toolbar as expected. However when clicking the button, Excel crashes with no warning or dialog box. I need to find out what I'm doing that is causing the userform to cause Excel to crash. I'm wondering if its related to not having a fully qualified object or something like that. Any help would be appreciated. Here's the code that invokes the user form. It is in a module called modStartForm: ================================================== == Public Sub ShowUFMain() On Error GoTo ErrorRoutine ufMain.Show ErrorRoutine: modErrorHandle.ErrorHandling "modStartform.ShowUFMain" End Sub ================================================== == There is some code relating to the invocation of the user form that is associated with the user form itself. The userform is called ufMain. Here is the relevant code: ================================================== == Private Sub UserForm_Activate() On Error GoTo ErrorRoutine 'Populate the Project Name If ActiveSheet.PageSetup.CenterHeader = "" Then For mRow = 1 To 20 For mCol = 1 To 20 If Left(Cells(mRow, mCol), 8) = "PROJECT:" Then ufMain.pg1ProjTitle_txt = Mid(Cells(mRow, mCol), 11) Next Next Else ufMain.pg1ProjTitle_txt = ActiveSheet.PageSetup.CenterHeader End If ErrorRoutine: modErrorHandle.ErrorHandling "ufMain.UserForm_Activate" End Sub ================================================== == Private Sub UserForm_Initialize() On Error GoTo ErrorRoutine Dim mCount, mRow, mCol As Integer ''''''''''''''''''''''''''''''''' 'Really, all this sub does is to populate the form with values ''''''''''''''''''''''''''''''''' 'Page 1 'Populate the various combo boxes If ufMain.pg1ColorCompletedColor_ddl.ListCount = 0 Then For mCount = 1 To 9 ufMain.pg1ColorCompletedColor_ddl.AddItem ufMain.pg1ColorMSColor_ddl.AddItem ufMain.pg1ColorParentColor_ddl.AddItem ufMain.pg1ColorStartDateColor_ddl.AddItem Next mCount End If 'Populate rows you just created With ufMain.pg1ColorCompletedColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With With ufMain.pg1ColorMSColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With With ufMain.pg1ColorParentColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With With ufMain.pg1ColorStartDateColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With 'Initialize Reporting Period txtboxes If ufMain.pg2ReportingMonth_txt = "" Then ufMain.pg2ReportingMonth_txt = Month(Date) - 1 If ufMain.pg2ReportingYear_txt = "" Then ufMain.pg2ReportingYear_txt = Year(Date) 'Initialize form fields from HKEY_CURRENT_USER registry 'First, check to see if hive keys exist, and if not, then create it ' and populate it with default values If RegistryKeyExists(mBaseKey, mKeyName) = False Then InitializeRegistryHive 'Now, copy values from registry into form fields LoadRegistryValuesIntoFormPage1 LoadRegistryValuesIntoFormPage2 LoadRegistryValuesIntoFormPage3 LoadRegistryValuesIntoFormPage4 'Load the Pg1 Template Combo Boxes LoadPg1TemplateComboBoxes '''''''''''''''''''''''' 'Add code to goto the Project Title control on page 1 '''''''''''''''''''''''''' 'ufMain.MultiPage1.Pages ("Page1") 'Me.txtProjTitle.SetFocus ErrorRoutine: modErrorHandle.ErrorHandling "ufMain.userform_Initialize" End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, Jim. I'll make that change, but that doesn't address the crash
problem. "Jim Cone" wrote: modErrorHandle is run every time in each sub. I don't believe that is actually what you want. Add "Exit Sub" as a separate line just before the "ErrorRoutine:" line. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "Stu W" wrote in message I have a VBA add-in that I've created for Excel. There is a user form. The add-in creates a command button on the Standard toolbar that, when clicked, causes the userform to display. The add-in compiles and installs without error, and adds the button to the toolbar as expected. However when clicking the button, Excel crashes with no warning or dialog box. I need to find out what I'm doing that is causing the userform to cause Excel to crash. I'm wondering if its related to not having a fully qualified object or something like that. Any help would be appreciated. Here's the code that invokes the user form. It is in a module called modStartForm: ================================================== == Public Sub ShowUFMain() On Error GoTo ErrorRoutine ufMain.Show ErrorRoutine: modErrorHandle.ErrorHandling "modStartform.ShowUFMain" End Sub ================================================== == There is some code relating to the invocation of the user form that is associated with the user form itself. The userform is called ufMain. Here is the relevant code: ================================================== == Private Sub UserForm_Activate() On Error GoTo ErrorRoutine 'Populate the Project Name If ActiveSheet.PageSetup.CenterHeader = "" Then For mRow = 1 To 20 For mCol = 1 To 20 If Left(Cells(mRow, mCol), 8) = "PROJECT:" Then ufMain.pg1ProjTitle_txt = Mid(Cells(mRow, mCol), 11) Next Next Else ufMain.pg1ProjTitle_txt = ActiveSheet.PageSetup.CenterHeader End If ErrorRoutine: modErrorHandle.ErrorHandling "ufMain.UserForm_Activate" End Sub ================================================== == Private Sub UserForm_Initialize() On Error GoTo ErrorRoutine Dim mCount, mRow, mCol As Integer ''''''''''''''''''''''''''''''''' 'Really, all this sub does is to populate the form with values ''''''''''''''''''''''''''''''''' 'Page 1 'Populate the various combo boxes If ufMain.pg1ColorCompletedColor_ddl.ListCount = 0 Then For mCount = 1 To 9 ufMain.pg1ColorCompletedColor_ddl.AddItem ufMain.pg1ColorMSColor_ddl.AddItem ufMain.pg1ColorParentColor_ddl.AddItem ufMain.pg1ColorStartDateColor_ddl.AddItem Next mCount End If 'Populate rows you just created With ufMain.pg1ColorCompletedColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With With ufMain.pg1ColorMSColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With With ufMain.pg1ColorParentColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With With ufMain.pg1ColorStartDateColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With 'Initialize Reporting Period txtboxes If ufMain.pg2ReportingMonth_txt = "" Then ufMain.pg2ReportingMonth_txt = Month(Date) - 1 If ufMain.pg2ReportingYear_txt = "" Then ufMain.pg2ReportingYear_txt = Year(Date) 'Initialize form fields from HKEY_CURRENT_USER registry 'First, check to see if hive keys exist, and if not, then create it ' and populate it with default values If RegistryKeyExists(mBaseKey, mKeyName) = False Then InitializeRegistryHive 'Now, copy values from registry into form fields LoadRegistryValuesIntoFormPage1 LoadRegistryValuesIntoFormPage2 LoadRegistryValuesIntoFormPage3 LoadRegistryValuesIntoFormPage4 'Load the Pg1 Template Combo Boxes LoadPg1TemplateComboBoxes '''''''''''''''''''''''' 'Add code to goto the Project Title control on page 1 '''''''''''''''''''''''''' 'ufMain.MultiPage1.Pages ("Page1") 'Me.txtProjTitle.SetFocus ErrorRoutine: modErrorHandle.ErrorHandling "ufMain.userform_Initialize" End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Also, I am betting that you do not have "Option Explicit" at the top of every module? -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins: special sorting, comparing, matching, listing, finding...) "Stu W" wrote in message Thanks, Jim. I'll make that change, but that doesn't address the crash problem. "Jim Cone" wrote: modErrorHandle is run every time in each sub. I don't believe that is actually what you want. Add "Exit Sub" as a separate line just before the "ErrorRoutine:" line. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, I do.
"Jim Cone" wrote: Also, I am betting that you do not have "Option Explicit" at the top of every module? -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins: special sorting, comparing, matching, listing, finding...) "Stu W" wrote in message Thanks, Jim. I'll make that change, but that doesn't address the crash problem. "Jim Cone" wrote: modErrorHandle is run every time in each sub. I don't believe that is actually what you want. Add "Exit Sub" as a separate line just before the "ErrorRoutine:" line. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Stu,
I had similar problem with an AddIn I created - after months of head scratching I traced it to a worksheet_change event calling a macro which should have only triggered when the form was visible. Not sure if applies to your but thought may be helpful. -- JB "Stu W" wrote: I have a VBA add-in that I've created for Excel. There is a user form. The add-in creates a command button on the Standard toolbar that, when clicked, causes the userform to display. The add-in compiles and installs without error, and adds the button to the toolbar as expected. However when clicking the button, Excel crashes with no warning or dialog box. I need to find out what I'm doing that is causing the userform to cause Excel to crash. I'm wondering if its related to not having a fully qualified object or something like that. Any help would be appreciated. Here's the code that invokes the user form. It is in a module called modStartForm: ================================================== == Public Sub ShowUFMain() On Error GoTo ErrorRoutine ufMain.Show ErrorRoutine: modErrorHandle.ErrorHandling "modStartform.ShowUFMain" End Sub ================================================== == There is some code relating to the invocation of the user form that is associated with the user form itself. The userform is called ufMain. Here is the relevant code: ================================================== == Private Sub UserForm_Activate() On Error GoTo ErrorRoutine 'Populate the Project Name If ActiveSheet.PageSetup.CenterHeader = "" Then For mRow = 1 To 20 For mCol = 1 To 20 If Left(Cells(mRow, mCol), 8) = "PROJECT:" Then ufMain.pg1ProjTitle_txt = Mid(Cells(mRow, mCol), 11) Next Next Else ufMain.pg1ProjTitle_txt = ActiveSheet.PageSetup.CenterHeader End If ErrorRoutine: modErrorHandle.ErrorHandling "ufMain.UserForm_Activate" End Sub ================================================== == Private Sub UserForm_Initialize() On Error GoTo ErrorRoutine Dim mCount, mRow, mCol As Integer ''''''''''''''''''''''''''''''''' 'Really, all this sub does is to populate the form with values ''''''''''''''''''''''''''''''''' 'Page 1 'Populate the various combo boxes If ufMain.pg1ColorCompletedColor_ddl.ListCount = 0 Then For mCount = 1 To 9 ufMain.pg1ColorCompletedColor_ddl.AddItem ufMain.pg1ColorMSColor_ddl.AddItem ufMain.pg1ColorParentColor_ddl.AddItem ufMain.pg1ColorStartDateColor_ddl.AddItem Next mCount End If 'Populate rows you just created With ufMain.pg1ColorCompletedColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With With ufMain.pg1ColorMSColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With With ufMain.pg1ColorParentColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With With ufMain.pg1ColorStartDateColor_ddl .List(0, 0) = 16777215 .List(0, 1) = "Clear" .List(1, 0) = 12632256 .List(1, 1) = "Gray" .List(2, 0) = 255 .List(2, 1) = "Red" .List(3, 0) = 0 .List(3, 1) = "Black" .List(4, 0) = 65280 .List(4, 1) = "Green" .List(5, 0) = 65535 .List(5, 1) = "Yellow" .List(6, 0) = 16711680 .List(6, 1) = "Blue" .List(7, 0) = 16711935 .List(7, 1) = "Magenta" .List(8, 0) = 16776960 .List(8, 1) = "Cyan" End With 'Initialize Reporting Period txtboxes If ufMain.pg2ReportingMonth_txt = "" Then ufMain.pg2ReportingMonth_txt = Month(Date) - 1 If ufMain.pg2ReportingYear_txt = "" Then ufMain.pg2ReportingYear_txt = Year(Date) 'Initialize form fields from HKEY_CURRENT_USER registry 'First, check to see if hive keys exist, and if not, then create it ' and populate it with default values If RegistryKeyExists(mBaseKey, mKeyName) = False Then InitializeRegistryHive 'Now, copy values from registry into form fields LoadRegistryValuesIntoFormPage1 LoadRegistryValuesIntoFormPage2 LoadRegistryValuesIntoFormPage3 LoadRegistryValuesIntoFormPage4 'Load the Pg1 Template Combo Boxes LoadPg1TemplateComboBoxes '''''''''''''''''''''''' 'Add code to goto the Project Title control on page 1 '''''''''''''''''''''''''' 'ufMain.MultiPage1.Pages ("Page1") 'Me.txtProjTitle.SetFocus ErrorRoutine: modErrorHandle.ErrorHandling "ufMain.userform_Initialize" End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel and Word crash when I try to add a UserForm | Excel Programming | |||
Add-In UserForm Crash | Excel Programming | |||
Failed userform loading and cause application crash | Excel Programming | |||
Userform & crash | Excel Programming | |||
Opening a UserForm causes a crash in the Exit procedure (Which is never called) | Excel Programming |