Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Supressing "Do you want to save the changes you made to <file?" message

Hi there

I have an Excel system that most of my users are only allowed to open
and view read-only.

I have volatile formulaes that mean that even when the user just views
and changes nothing when they close the file Excel asks them:

"Do you want to save the changes you made to <file?"

The problem is that this confuses the user as they now think they have
made a change.

I was hoping to suppress this message and replace with my own more
helpful message - but I got stuck at the first part:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
MsgBox "Workbook_BeforeClose"
Application.DisplayAlerts = False
End Sub

Seems disabling alerts is not good enough. Does anyone know how I can
supress the above message?

Thanks for any ideas.
Chrisso

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Supressing "Do you want to save the changes you made to <file?" message

Hi Chrisso,

Try:

'=============
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Saved = True
End Sub
'<<=============


---
Regards,
Norman


"Chrisso" wrote in message
oups.com...
Hi there

I have an Excel system that most of my users are only allowed to open
and view read-only.

I have volatile formulaes that mean that even when the user just views
and changes nothing when they close the file Excel asks them:

"Do you want to save the changes you made to <file?"

The problem is that this confuses the user as they now think they have
made a change.

I was hoping to suppress this message and replace with my own more
helpful message - but I got stuck at the first part:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
MsgBox "Workbook_BeforeClose"
Application.DisplayAlerts = False
End Sub

Seems disabling alerts is not good enough. Does anyone know how I can
supress the above message?

Thanks for any ideas.
Chrisso



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Supressing "Do you want to save the changes you made to <file?" message

But what is a change is made AND it needs to be Saved?
Wont this code (at present) close the WB, without saving such changes?

TIA,
Jim

"Norman Jones" wrote in message
:

Hi Chrisso,

Try:

'=============
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Saved = True
End Sub
'<<=============


---
Regards,
Norman


"Chrisso" wrote in message
oups.com...
Hi there

I have an Excel system that most of my users are only allowed to open
and view read-only.

I have volatile formulaes that mean that even when the user just views
and changes nothing when they close the file Excel asks them:

"Do you want to save the changes you made to <file?"

The problem is that this confuses the user as they now think they have
made a change.

I was hoping to suppress this message and replace with my own more
helpful message - but I got stuck at the first part:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
MsgBox "Workbook_BeforeClose"
Application.DisplayAlerts = False
End Sub

Seems disabling alerts is not good enough. Does anyone know how I can
supress the above message?

Thanks for any ideas.
Chrisso


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Supressing "Do you want to save the changes you made to <file?" message

If it is read-only, they can't save it anyway.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"JMay" wrote in message
...
But what is a change is made AND it needs to be Saved?
Wont this code (at present) close the WB, without saving such changes?

TIA,
Jim

"Norman Jones" wrote in message
:

Hi Chrisso,

Try:

'=============
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Saved = True
End Sub
'<<=============


---
Regards,
Norman


"Chrisso" wrote in message
oups.com...
Hi there

I have an Excel system that most of my users are only allowed to open
and view read-only.

I have volatile formulaes that mean that even when the user just views
and changes nothing when they close the file Excel asks them:

"Do you want to save the changes you made to <file?"

The problem is that this confuses the user as they now think they have
made a change.

I was hoping to suppress this message and replace with my own more
helpful message - but I got stuck at the first part:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
MsgBox "Workbook_BeforeClose"
Application.DisplayAlerts = False
End Sub

Seems disabling alerts is not good enough. Does anyone know how I can
supress the above message?

Thanks for any ideas.
Chrisso




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Supressing "Do you want to save the changes you made to <file?" message

Thanks Bob, But OP says (that):

I have an Excel system that most of my users are only allowed to open

and view read-only




Just thought I'd mention.



"Bob Phillips" wrote in message
:



If it is read-only, they can't save it anyway.




--


HTH




Bob




(there's no email, no snail mail, but somewhere should be gmail in my addy)




"JMay" wrote in message


...


But what is a change is made AND it needs to be Saved?


Wont this code (at present) close the WB, without saving such changes?




TIA,


Jim




"Norman Jones" wrote in message


:




Hi Chrisso,




Try:




'=============


Private Sub Workbook_BeforeClose(Cancel As Boolean)


Me.Saved = True


End Sub


'<<=============






---


Regards,


Norman






"Chrisso" wrote in message


oups.com...


Hi there




I have an Excel system that most of my users are only allowed to open


and view read-only.




I have volatile formulaes that mean that even when the user just views


and changes nothing when they close the file Excel asks them:




"Do you want to save the changes you made to <file?"




The problem is that this confuses the user as they now think they have


made a change.




I was hoping to suppress this message and replace with my own more


helpful message - but I got stuck at the first part:




Private Sub Workbook_BeforeClose(Cancel As Boolean)


MsgBox "Workbook_BeforeClose"


Application.DisplayAlerts = False


End Sub




Seems disabling alerts is not good enough. Does anyone know how I can


supress the above message?




Thanks for any ideas.


Chrisso









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Supressing "Do you want to save the changes you made to <file?" message

Hi Jim,

I missed the word "most"! Well spotted!

That being the case, try something like:

'=============
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Arr As Variant
Dim Res As Variant

Arr = VBA.Array("Chrissol", "Jim", "Bob", "Norman")

Res = Application.Match(Environ("UserName"), Arr, 0)
Me.Saved = IsError(Res)
End Sub
'<<=============

The array values correspond to the users who do have
write permission.


---
Regards,
Norman




"JMay" wrote in message
...
Thanks Bob, But OP says (that):

I have an Excel system that most of my users are only allowed to open

and view read-only




Just thought I'd mention.



"Bob Phillips" wrote in message
:



If it is read-only, they can't save it anyway.




--


HTH




Bob




(there's no email, no snail mail, but somewhere should be gmail in my
addy)




"JMay" wrote in message


...


But what is a change is made AND it needs to be Saved?


Wont this code (at present) close the WB, without saving such changes?




TIA,


Jim



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Supressing "Do you want to save the changes you made to <file?" message

No problem, u da man !!
Jim

"Norman Jones" wrote in message
:

Hi Jim,

I missed the word "most"! Well spotted!

That being the case, try something like:

'=============
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Arr As Variant
Dim Res As Variant

Arr = VBA.Array("Chrissol", "Jim", "Bob", "Norman")

Res = Application.Match(Environ("UserName"), Arr, 0)
Me.Saved = IsError(Res)
End Sub
'<<=============

The array values correspond to the users who do have
write permission.


---
Regards,
Norman




"JMay" wrote in message
...
Thanks Bob, But OP says (that):

I have an Excel system that most of my users are only allowed to open

and view read-only




Just thought I'd mention.



"Bob Phillips" wrote in message
:



If it is read-only, they can't save it anyway.




--


HTH




Bob




(there's no email, no snail mail, but somewhere should be gmail in my
addy)




"JMay" wrote in message


...


But what is a change is made AND it needs to be Saved?


Wont this code (at present) close the WB, without saving such changes?




TIA,


Jim


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
Selecting "Save As" adds "Copy of" to file name- MS Excel 2007 ronhansen Excel Discussion (Misc queries) 1 November 15th 09 09:33 PM
remove the default,"Do you want to save changes made to xxx.xls?" Philly Flash Excel Discussion (Misc queries) 3 October 25th 06 11:45 PM
Can't save excel file. The message reads "File is locked" Why is t Art Caragh Excel Discussion (Misc queries) 1 March 29th 06 02:11 PM
File Always Asks "Save Changes Y/N" even when no changes made Nicholas B Excel Programming 1 February 11th 05 01:23 PM
Problem- Recording macros for "file save" and "File open" tritaco Excel Programming 1 April 22nd 04 06:15 PM


All times are GMT +1. The time now is 12:05 AM.

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

About Us

"It's about Microsoft Excel"