R
Rockee052
Hello,
I posted a question on this before and thought I came up with my ow
solution but, If you are reading this you can tell my solution did no
work . So I have a couple of questions and would appreciate an
help or suggestions.
1) Can I run an automacro xlclose so, that before excel closes it run
my Workbook_BeforeClose procedure?
2) Reason why I want to run the WorkBook_BeforeClose:
Because I have a custom menu and a duplicate save as dialog box so, i
the user clicks on cancel my menu is not deleted.
3) Can you run an automacro then quit the application?
Here is what I have been working with:
BTW, My keyboard says help him please! I cant take anymore abuse! :mad
'To duplicate excels save dialog box
If Not Me.Saved Then
Dim Msg As String
Dim Ans As Integer
Beep
Msg = "Do you want to save the changes you made to "
Msg = Msg & Me.Name & "?"
Ans = MsgBox(Msg, vbQuestion + vbYesNoCancel)
Select Case Ans
Case vbYes
Me.Save
Case vbNo
Me.Saved = True
Case vbCancel
Cancel = True
Exit Sub
End Select
End If
Call DeleteMenu
End Sub
'What I have been using to close the workbook but, I actually want t
close the application via commandbutton.
Private Sub CommandButton3_Click()
With ActiveWorkbook
.RunAutoMacros xlAutoClose
.Close
End With
End Sub
I have tried putting Application.ScreenUpdating = False
and that will work if the user clicks on ok or cancel but if the use
clicks on yes it bring up excels save dialog box.
Summary: Close excel (application.quit) via commandbutton, befor
exiting it will call my custom save dialog.
Again, any suggestion will be MUCH appreciated...
Rockee Freeman
Excel 200
I posted a question on this before and thought I came up with my ow
solution but, If you are reading this you can tell my solution did no
work . So I have a couple of questions and would appreciate an
help or suggestions.
1) Can I run an automacro xlclose so, that before excel closes it run
my Workbook_BeforeClose procedure?
2) Reason why I want to run the WorkBook_BeforeClose:
Because I have a custom menu and a duplicate save as dialog box so, i
the user clicks on cancel my menu is not deleted.
3) Can you run an automacro then quit the application?
Here is what I have been working with:
BTW, My keyboard says help him please! I cant take anymore abuse! :mad
'To duplicate excels save dialog box
If Not Me.Saved Then
Dim Msg As String
Dim Ans As Integer
Beep
Msg = "Do you want to save the changes you made to "
Msg = Msg & Me.Name & "?"
Ans = MsgBox(Msg, vbQuestion + vbYesNoCancel)
Select Case Ans
Case vbYes
Me.Save
Case vbNo
Me.Saved = True
Case vbCancel
Cancel = True
Exit Sub
End Select
End If
Call DeleteMenu
End Sub
'What I have been using to close the workbook but, I actually want t
close the application via commandbutton.
Private Sub CommandButton3_Click()
With ActiveWorkbook
.RunAutoMacros xlAutoClose
.Close
End With
End Sub
I have tried putting Application.ScreenUpdating = False
and that will work if the user clicks on ok or cancel but if the use
clicks on yes it bring up excels save dialog box.
Summary: Close excel (application.quit) via commandbutton, befor
exiting it will call my custom save dialog.
Again, any suggestion will be MUCH appreciated...
Rockee Freeman
Excel 200