excel saving files

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Excel saving of files

Excel saving of files

resolvedResolved · Low Priority · Version 2007

Jon has attended:
Excel Intermediate course
Excel Intermediate course
Excel Advanced course
Excel Advanced course
Excel VBA Intro Intermediate course

Excel saving of files

I wish to prevent someone from saving a file, how can I do that without windows rights management

RE: excel saving of files

Hi Jon,

Thank you for your question and welcome to the forum.

The following VBA code will disable the Save As feature when Office button Save As is used or the keyboard shortcut Function key F12:

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

You need to copy the code above into the VBA window and paste it into the Workbook before save event. Please use the link below to try this procedure:

1. Copy the Excel VBA code in this response from Private Sub to End Sub.

2. Select the workbook in which you want to store the code.

3.Hold the Alt key, and press the F11 key, to open the Visual Basic Editor.

4. In the Project Explorer, find your workbook, and open the list of Microsoft Excel Objects.

5. Right-click or double click on the ThisWorkbook object, and choose View Code.

6. Where the cursor is flashing, choose Edit | Paste

Everytime someone tries to use the Save As command or F12 it will not allow it and displays a message box to display a message saying only Save is allowed.

I hope this helps and makes sense.

Regards

Simon

Thu 1 Dec 2011: Automatically marked as resolved.


 

Excel tip:

Create Equations in Excel 2010

Here's how to create basic mathematical
equations in your Excel 2010 worksheet.

1) On the Ribbon, click the Insert tab
2) In the Symbols group, click the arrow next to Equation
3) Select from the equations and the equation will be inserted in a text box

Or you can create your own equation:

1) Insert and select the text box
2) On the Ribbon, click the Insert tab
3) In the Symbols group, click Equation
4) The Equation Tools Design Ribbon will now be displayed

View all Excel hints and tips


Server loaded in 0.1 secs.