LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default excell error on close with commandbutton

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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error with Calendar object and CommandButton Morris[_2_] Excel Programming 3 September 19th 06 11:39 AM
How do I close excell worksheet without closing others still open John Excel Worksheet Functions 2 July 20th 06 06:17 PM
run-time error '91'-Close Button error ASCO IS Help Excel Discussion (Misc queries) 1 May 8th 06 04:25 PM
Running a CommandButton in Excel I get this error Bert[_4_] Excel Programming 4 May 5th 04 07:06 PM
Close WorkBook with CommandButton Rockee052[_50_] Excel Programming 3 February 23rd 04 04:04 AM


All times are GMT +1. The time now is 08:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"