PDA

View Full Version : Read Only file - Stop from asking for Save



pcsparky
02-10-2009, 01:45 AM
I have a file that has userforms to create other files ot open them. It also contains data.

I don't want to allow other users to share the workbook because I don't want them to be able to update the data.

Without Workbook Sharing they are still able to use the application to open the other files from this original file it's just that they have to use it in Read Only mode.

The problem is that when they come to close the file they are asked if they want to save a copy. I want the answer always to be NO.

Is there a way with code to achieve what I want please?

Bob Phillips
02-10-2009, 02:11 AM
in code



Activeworkbook.Close SaveChanges:=False

Simon Lloyd
02-10-2009, 02:13 AM
Yes ad this to the Thisworkbook modulePrivate Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub

pcsparky
02-10-2009, 09:05 AM
Thanks guys will try them out soon to see which best fits what I want.