P
pswanie
i got a userform with a command button. (caption "close") used to work fine.
but i worked on it just now. not the button code it self and not even in the
workbook before close.
now when i click the close button i get
-----------------------------------------------
microsoft office excel has encountered a problem and needs to close
---------------------------------------------------------------
i exported the 4 userforms and 6 modules and copy the pages in a new
workbook. renamed and imported the userform and modules. then it stoped for
a couple times but back now again....
here is some of my code
Private Sub Workbook_Open()
Sheets("Sheet1").Select
Worksheets("sheet1").Range("K4").Value = False
Worksheets("sheet1").Range("K5").Value = False
Worksheets("sheet1").Range("K6").Value = False
Worksheets("sheet1").Range("K7").Value = False
Worksheets("sheet1").Range("K8").Value = False
With Application
.Calculation = xlCalculationAutomatic
.MaxChange = 0.001
End With
Application.Visible = False
UserForm1.Show
UserForm1.TextBox1.Value = ""
UserForm1.CheckBox1.Value = False
UserForm1.CheckBox2.Value = False
UserForm1.CheckBox3.Value = False
UserForm1.CheckBox4.Value = False
UserForm1.CheckBox5.Value = False
End Sub
--------------------------------------------------------------------------
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
Application.Visible = True
End Sub
-------------------------------------------------------------------------------
Private Sub CommandButton4_Click()
Unload UserForm1
Sheets("Sheet1").Select
ActiveWorkbook.Save
Application.Quit
End Sub
but i worked on it just now. not the button code it self and not even in the
workbook before close.
now when i click the close button i get
-----------------------------------------------
microsoft office excel has encountered a problem and needs to close
---------------------------------------------------------------
i exported the 4 userforms and 6 modules and copy the pages in a new
workbook. renamed and imported the userform and modules. then it stoped for
a couple times but back now again....
here is some of my code
Private Sub Workbook_Open()
Sheets("Sheet1").Select
Worksheets("sheet1").Range("K4").Value = False
Worksheets("sheet1").Range("K5").Value = False
Worksheets("sheet1").Range("K6").Value = False
Worksheets("sheet1").Range("K7").Value = False
Worksheets("sheet1").Range("K8").Value = False
With Application
.Calculation = xlCalculationAutomatic
.MaxChange = 0.001
End With
Application.Visible = False
UserForm1.Show
UserForm1.TextBox1.Value = ""
UserForm1.CheckBox1.Value = False
UserForm1.CheckBox2.Value = False
UserForm1.CheckBox3.Value = False
UserForm1.CheckBox4.Value = False
UserForm1.CheckBox5.Value = False
End Sub
--------------------------------------------------------------------------
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
Application.Visible = True
End Sub
-------------------------------------------------------------------------------
Private Sub CommandButton4_Click()
Unload UserForm1
Sheets("Sheet1").Select
ActiveWorkbook.Save
Application.Quit
End Sub