Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel close/save/prompt problem

I have tried every thing I have seen on this site and so far I can't ge
it to do what I want.

I simply want excel, regardless of who is viewing the file, to no
prompt to save changes when closing excel itself or the workbook..
This sound easy enough by putting the following code in thisworkbook:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
Application.EnableEvents = False
ThisWorkbook.Saved = True
End Sub

However.. If I just highlight a few cells and try to close it exce
still prompts me to save.


Here is my complete thisworkbook code:

Private Sub Workbook_Open()
ActiveWindow.DisplayWorkbookTabs = False
Sheets("master").Select
ActiveSheet.ComboBox1.activate
Application.DisplayAlerts = False
Application.EnableEvents = False

End Sub


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
Application.EnableEvents = False
ThisWorkbook.Saved = True
End Sub


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel A
Boolean)
If SaveAsUI = True Then
MsgBox "Only have one copy of this form. Sorry, No exceptions."
Cancel = True
Exit Sub
End If

End Sub




I want to be able to manually save the file myself somehow but no
allow anyone else. And to definatly not prompt to save over my file.

Also, if I use
Application.DisplayAlerts = False
Application.EnableEvents = False


then the following has no effect


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel A
Boolean)
If SaveAsUI = True Then
MsgBox "Only have one copy of this form. Sorry, No exceptions."
Cancel = True
Exit Sub
End If

End Sub


:confused

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Excel close/save/prompt problem

Clayton,

Try:

Application.DisplayAlerts = False
Application.Quit
End Sub

HTH
Henry

"clayton " wrote in message
...
I have tried every thing I have seen on this site and so far I can't get
it to do what I want.

I simply want excel, regardless of who is viewing the file, to not
prompt to save changes when closing excel itself or the workbook...
This sound easy enough by putting the following code in thisworkbook:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
Application.EnableEvents = False
ThisWorkbook.Saved = True
End Sub

However.. If I just highlight a few cells and try to close it excel
still prompts me to save.


Here is my complete thisworkbook code:

Private Sub Workbook_Open()
ActiveWindow.DisplayWorkbookTabs = False
Sheets("master").Select
ActiveSheet.ComboBox1.activate
Application.DisplayAlerts = False
Application.EnableEvents = False

End Sub


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
Application.EnableEvents = False
ThisWorkbook.Saved = True
End Sub


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If SaveAsUI = True Then
MsgBox "Only have one copy of this form. Sorry, No exceptions."
Cancel = True
Exit Sub
End If

End Sub




I want to be able to manually save the file myself somehow but not
allow anyone else. And to definatly not prompt to save over my file.

Also, if I use
Application.DisplayAlerts = False
Application.EnableEvents = False


then the following has no effect


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If SaveAsUI = True Then
MsgBox "Only have one copy of this form. Sorry, No exceptions."
Cancel = True
Exit Sub
End If

End Sub





---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel close/save/prompt problem

Assuming you wanted me to put it in the Workbook_BeforeClose
(very new to all this)
it did not work for me. If I so much as highlight a cell it will promp
me to save changes when I try to close excel..

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Excel close/save/prompt problem

Clayton,

Sorry, I should have told you to put it in the Workbook_BeforeSave event.

HTH
Henry

"clayton " wrote in message
...
Assuming you wanted me to put it in the Workbook_BeforeClose
(very new to all this)
it did not work for me. If I so much as highlight a cell it will prompt
me to save changes when I try to close excel...


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel close/save/prompt problem

Thank you very much for your help. It is working great now!


---
Message posted from http://www.ExcelForum.com/



Reply
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
Excel save prompt R Ormerod Excel Discussion (Misc queries) 6 September 10th 07 04:22 PM
Excel Save Changes Prompt Billyg Excel Discussion (Misc queries) 1 January 30th 07 04:55 PM
save prompt for user exit, but no save prompt for batch import? lpj Excel Discussion (Misc queries) 1 February 25th 06 02:08 AM
Save Changes Prompt at close Johnewally Excel Discussion (Misc queries) 2 March 17th 05 09:15 PM
How can I get "File Close" to prompt me to "Save Changes" ?? Charles Jordan Excel Programming 4 July 31st 03 04:01 PM


All times are GMT +1. The time now is 09:33 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"