Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
is it possible to disable the ability to save a file unless the u.
I'm trying to stop users from saving a file unless they have entered an
explanatory note in a specified cell (or perhaps range). Is this possible and, if so, how? Instructions for a warning message would also be useful. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
is it possible to disable the ability to save a file unless the u.
Something like this should do it for you. Change the sheet name and cell
reference as needed. It will look at the specified cell and if nothing is in it, it will present the message and cancel the save operation. If something is in the cell, it just saves as usual. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If IsEmpty(Worksheets("Sheet1").Range("F9")) Then MsgBox "You must make an entry on Sheet1, in Cell F9 before saving.", _ vbOKOnly, "Save Cancelled" Cancel = True Exit Sub End If End Sub This page will help you in getting the code into the right place in the workbook: http://www.jlathamsite.com/Teach/WorkbookCode.htm "AucklandAssault" wrote: I'm trying to stop users from saving a file unless they have entered an explanatory note in a specified cell (or perhaps range). Is this possible and, if so, how? Instructions for a warning message would also be useful. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
is it possible to disable the ability to save a file unless the u.
Anything you could do would be defeated if users disabled macros when opening
the workbook but yes you can prevent saving if users enable macros. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If Sheet1.Range("A1").Value = "" Then Cancel = True MsgBox "Please complete cell A1" End If End Sub Copy Jim Rech's code above into the Thisworkbook module. To open that module right-click on the Excel Icon left of "File" on the menu. Select "View Code" Paste into that module. Gord Dibben MS Excel MVP On Wed, 8 Nov 2006 09:59:01 -0800, AucklandAssault wrote: I'm trying to stop users from saving a file unless they have entered an explanatory note in a specified cell (or perhaps range). Is this possible and, if so, how? Instructions for a warning message would also be useful. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
default save as file type does not work | Excel Discussion (Misc queries) | |||
Cannot save Project file as MS Access file | Excel Discussion (Misc queries) | |||
Disable Dialogue Box To Save & Replace File | Excel Discussion (Misc queries) | |||
Additional file with no extension created during File Save As proc | Excel Discussion (Misc queries) | |||
Excell2003 (SP-1) File > Save and File > Save As.. grayed out | Excel Discussion (Misc queries) |