Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Stop Save as code

Hi there guys,

is there a code to stop a user to save as if not all fields are filled
in?

thanks for your help

alex
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Stop Save as code

On Jan 2, 7:06 am, wrote:
Hi there guys,

is there a code to stop a user to save as if not all fields are filled
in?

thanks for your help

alex


You could use a boolean value to specify whether all the fields are
filled in.
And then only save workbook when the value is true, false to cancel.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Not mbAllFilled Then 'mbAllFilled is used to specify whether all
the fields are filled in.
Cancel = True
MsgBox "Please fill all of fields before you save it!"
End If
End Sub
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 477
Default Stop Save as code

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = SaveAsUI
End Sub

The above Is the basic "to Cancel any SaveAs attempt" - maybe add as If then
statement to perform the Cancel = SaveAsUI line...

HTH,

Jim


" wrote:

Hi there guys,

is there a code to stop a user to save as if not all fields are filled
in?

thanks for your help

alex

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Stop Save as code

The replies to your other thread include a line like:

Cancel = True

That line stops the Save.

ps. It's better to stick in the same thread when you have followup questions.

wrote:

Hi there guys,

is there a code to stop a user to save as if not all fields are filled
in?

thanks for your help

alex


--

Dave Peterson
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
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: harpscardiff[_10_] Excel Programming 8 November 10th 05 12:24 PM
Stop asking to save changes Traci Excel Discussion (Misc queries) 3 October 11th 05 03:51 PM
Stop Save As prompt Office User Excel Programming 2 May 12th 05 08:14 PM
Using ExitSub to stop a Save universal[_9_] Excel Programming 3 December 2nd 03 11:14 AM
VBA how can I stop a Save newboy18[_2_] Excel Programming 5 December 1st 03 04:27 PM


All times are GMT +1. The time now is 08:31 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"