Disable Quick Save & Save As

L

L Weber

I have found a string (below) to put into M.V.B. that works great for this.
When I click over to the excel file it does not allow me to Q.Save or
File/Save as….. But now I cannot save the file with the new macro because I
have disabled that function? I am a newbie to M.V.B. but this seems like
some strange Catch 22 situation…. Please help if possible.


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

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = True
End Sub
 
L

L Weber

Mike,
That was it... Thanks a bunch... Now next question How do I stop
the "XXX.XLS is read only to save a copy.........." It does not allow me to
do this but I would like to get rid of the pesky dialougue box. Thanks a
bunch for your help......
 
G

Gord Dibben

Application.DisplayAlerts = False

'code to run here

Application.DisplayAlerts = True


Gord Dibben MS Excel MVP
 
A

Alan

Not sure what you're trying to achieve here but if it's to prevent
unauthorised copying of the file, whilst it will work it's not at all
secure. All the user has to do is what Mike H suggested, ie open the file
with macros disabled, then they can save as they please.
You can prevent uninformed casual users from doing this, but even with those
you need to be far more devious. No matter how devious you are you cannot
prevent anyone with relatively little knowledge and the will to do so from
circumventing your efforts, Excel security is not its strong point.
Regards,
Alan.
 
L

L Weber

Thans Gord I will tray it out today.
--
L Weber


Gord Dibben said:
Application.DisplayAlerts = False

'code to run here

Application.DisplayAlerts = True


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top