Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Opening as Read Only

I have set up a macro to open a file as read only, when I open it, i
does open as read only.

When I close it, it asks me if I would like to save the changes
although this happens you cant save the file - because it is rea
only.

Is there a way of getting rid of this dialog box so that the optio
doesnt come up to save as and the file just closes

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Opening as Read Only

But you could save it as a new name. If you want make it more difficult to do
even that:

Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Saved = True
End Sub

Under the ThisWorkbook module.

You may want to put a little workaround for yourself:

Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If LCase(Application.UserName) Like "*ianripping*" Then
'nothing special
Else
Me.Saved = True
End If
End Sub

This looks like a problem just waiting to happen for the developer (you???).

When you spend more than a few minutes making changes and close by mistake,
you'll be sorry <vbg.


"ianripping <" wrote:

I have set up a macro to open a file as read only, when I open it, it
does open as read only.

When I close it, it asks me if I would like to save the changes,
although this happens you cant save the file - because it is read
only.

Is there a way of getting rid of this dialog box so that the option
doesnt come up to save as and the file just closes?

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


--

Dave Peterson

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
file keeps opening as read only Sal Excel Discussion (Misc queries) 3 November 6th 08 10:43 PM
Opening read-only files on a network Dryzz Excel Discussion (Misc queries) 1 October 10th 07 10:32 PM
My files are opening as read only but I'm not tagging them. Help! Tracy Excel Discussion (Misc queries) 5 September 13th 07 12:36 AM
File always opening as read only Larry Wallis Excel Discussion (Misc queries) 1 February 4th 05 02:22 PM
opening workbook as read-only Mariusz Excel Programming 2 May 25th 04 08:53 AM


All times are GMT +1. The time now is 05:10 PM.

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"