Opening as Read Only

I

ianripping

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
 
D

Dave Peterson

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>.
 
Top