Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
default save as file type does not work gregf Excel Discussion (Misc queries) 5 February 10th 06 07:50 PM
Cannot save Project file as MS Access file Jumpinjackflash Excel Discussion (Misc queries) 1 January 11th 06 11:35 PM
Disable Dialogue Box To Save & Replace File Dolphinv4 Excel Discussion (Misc queries) 2 October 24th 05 05:42 AM
Additional file with no extension created during File Save As proc Peter Rooney Excel Discussion (Misc queries) 2 August 11th 05 02:48 PM
Excell2003 (SP-1) File > Save and File > Save As.. grayed out Joe Murphy Excel Discussion (Misc queries) 0 March 9th 05 10:00 PM


All times are GMT +1. The time now is 01:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"