excel saving files
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

replyReply Tue 22 Nov 2011, 16:13Delegate Jon said...

Excel saving of files

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

For upcoming training course dates see: Pricing & availability

replyReply Fri 25 Nov 2011, 12:26Trainer Simon said...

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.

 

Please browse our web site to find out more about
microsoft.excel.courses.in.london and other Microsoft training courses.

Excel tip:

Generating Random Numbers

To generate a random number in Excel use the = RAND() function.

The value returned will always be between 0 and 1. To convert this to some other random value, you will need to multiply the result by the highest number you want to consider. For example, if you wanted a random number between 1 and 25, you could use the following code line:
= INT(25 * RAND()+ 1)

Since RAND() will always returns a value between 0 and 1 (but never 1 itself), multiplying what it returns by 25 and then using the Integer function INT on that result will return a whole number between 0 and 24.

Finally, 1 is added to this result, so that x will be equal to a number between 1 and 25, inclusive

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard