Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have tried this macro to disable the save function if the cell A1 contains the value 1 when the user wants to save the file I want the file to close without asking if the user any questions, but there seems to be a coding error. Can anyone help please? PS I imagine I should also use the same code for the event "Private Sub Workbook_BeforeClose"? Thank you in advance André Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If Worksheets("Start").Cells(1, 1) = 1 Then MsgBox "You have already Eliminated Rows! THIS FILE WILL NOT SAVE!" ActiveWorkbook.Close = False End If End Sub In ELIMINATE ROWS MACRO: Worksheets("Master").Cells(1,1).Value = 1 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Save Condition | Excel Worksheet Functions | |||
Save If Condition is true | Excel Programming | |||
Code to Test Condition and Save Record to Excel | Excel Programming | |||
Excel marcos firing on file save as but not file save | Excel Programming | |||
Save File to Another Directory, but not change Users File Save location | Excel Programming |