Disabling SAVE AS Temporarily

M

monir

Hello;

I need to disable the File option Save As while the file test.xls is open,
and return to normal File options on exit.
How to do that ??
The following w/b event DOES NOT produce the desired effect:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
'MS Excel help: SaveAsUi True if the Save As dialog box will be displayed
SaveAsUI = False
End Sub

Thank you.
 
J

JP

How about

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If SaveAsUI Then
MsgBox ("The 'Save As' function has been disabled."), vbInformation,
"Save As Disabled"
Cancel = True
End If
End Sub



HTH,
JP
 
M

monir

Perfect! Thank you very much.


JP said:
How about

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If SaveAsUI Then
MsgBox ("The 'Save As' function has been disabled."), vbInformation,
"Save As Disabled"
Cancel = True
End If
End Sub



HTH,
JP
 

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