View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default how to disable saving???

Will this "master" file always have the same name. Then you can check this
in the BeforeSave event in the thisworkbook module (see Chip Pearson's site
if you are not familiar with events:
http://www.cpearson.com/excel/events.htm )

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
if Thisworkbook.Name = "MyMasterBook.xls" then
msgbox "Can not save with this name - do saveas with a new name"
Cancel = True
End if
End Sub

--
Regards,
Tom Ogilvy


"willroy" wrote in message
...
Hi,

In my code I want to temporarily disable the user to be able to save
the spreadsheet.

The reason for this is that in my macro, I have created a manual filter
which uses the actual file of data so saves cannot be made over that as
I will be in deep ****!

I do not want to disable it totally as I have a msgbox asking to save
and if yes, it save automatically with programmed name in a programmed
folder.

PLEASE HELP!!!

Thank you

Will


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