Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default how to close Read Only file without prompt to save copy

Hi
I'm working on an Excel file that will always be opened as Read Only by users.
To save confusion I would rather the user is not prompted to save the file
on exit.
I've tried application.displayAlerts = False in the Workbook BeroreClose
event code
but no joy so far.
Is it posible to achieve this?
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default how to close Read Only file without prompt to save copy

Try

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Close False
End Sub


--
Jacob (MVP - Excel)


"David" wrote:

Hi
I'm working on an Excel file that will always be opened as Read Only by users.
To save confusion I would rather the user is not prompted to save the file
on exit.
I've tried application.displayAlerts = False in the Workbook BeroreClose
event code
but no joy so far.
Is it posible to achieve this?
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default how to close Read Only file without prompt to save copy

Thanks Jacob (I made sure to click on yes)

Worked fine

Is there any way to close the application "shell" along with the file
as is usual with only a single file open?

"Jacob Skaria" wrote:

Try

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Close False
End Sub


--
Jacob (MVP - Excel)


"David" wrote:

Hi
I'm working on an Excel file that will always be opened as Read Only by users.
To save confusion I would rather the user is not prompted to save the file
on exit.
I've tried application.displayAlerts = False in the Workbook BeroreClose
event code
but no joy so far.
Is it posible to achieve this?
Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default how to close Read Only file without prompt to save copy

Ofcourse YES; Try the below. Be careful this will quit the app; even if you
have other workbooks open..


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

--
Jacob (MVP - Excel)


"David" wrote:

Thanks Jacob (I made sure to click on yes)

Worked fine

Is there any way to close the application "shell" along with the file
as is usual with only a single file open?

"Jacob Skaria" wrote:

Try

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Close False
End Sub


--
Jacob (MVP - Excel)


"David" wrote:

Hi
I'm working on an Excel file that will always be opened as Read Only by users.
To save confusion I would rather the user is not prompted to save the file
on exit.
I've tried application.displayAlerts = False in the Workbook BeroreClose
event code
but no joy so far.
Is it posible to achieve this?
Thanks

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
Macro to save and close, then copy file NewSysAdmin Excel Discussion (Misc queries) 2 December 2nd 09 03:24 PM
Save copy of file to open as read only Ray Clark[_2_] Excel Discussion (Misc queries) 2 June 20th 08 12:19 AM
Intercepting the file save prompt before close? Neil Bhandar[_4_] Excel Programming 3 February 14th 06 03:19 AM
CLOSE ALL macro for XL2K (but with prompt to save for each file)? StargateFan[_3_] Excel Programming 2 August 10th 05 02:32 PM
Save Changes Prompt at close Johnewally Excel Discussion (Misc queries) 2 March 17th 05 09:15 PM


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