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

excel saving files

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

Excel saving of files

ResolvedVersion 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:

Bracketed negative numbers

Often Excel users wish to display negative numbers in colour red and bracketed

Intstructions
Step1. Select Format > Cells menu options. Within Numbers tabsheet, select Category = Custom.
Step 2. Select a type such as #,##0;[Red]-#,##0;; that specifies a colour in square brackets.
Step 3. Amend as follows; #,##0;[Red](#,##0;;

Notes: Excel formatting featues are of the form
"Positive; Negative;Zero;Text" separated by semicolon.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.