Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling Saving a workbook in excel until a condition is met. 1

Status
Not open for further replies.

simdan42

Programmer
Jul 17, 2002
118
US
I would like to disable the ability for a user to save the workbook until a certain condition is met. What is the best way to disable saving or to catch the save event and ignore it?
 
Hi
Here's one possibility

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Not your condition Then
    Cancel = True
End If
End Sub

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
Well, *I* think thats worth a star, anyway!

VBAjedi [swords]
 
Well Thank You Jedi
May the Seventh be with you!

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top