How To Disable Save Prompt When Close Workbook?


Have you ever been frustrated by the constant save prompt that appears every time you try to close an Excel workbook? If you find yourself regularly working with Excel files that don't require frequent saving or if you prefer to manually save your work, disabling the save prompt can save you time and help streamline your workflow.

In this tutorial, we will guide you through the process of disabling the save prompt in Excel, so you no longer have to deal with the interruption of being prompted to save your workbook every time you close it. Whether you're a seasoned Excel user or just starting out, this tutorial will provide you with step−by−step instructions and screenshots to help you easily follow along. So, let's get started and learn how to disable the save prompt when closing a workbook in Excel!

Disable Save Prompt When Close Workbook

Here, we will first create a VBA module and then run it to complete the task. So let us see a simple process to know how you can disable the save prompt when closing a workbook in Excel.

Step 1

Consider any Excel sheet. First, right−click on the sheet name and click on View Code to open the VBA application, then click on Inset and select Module.

Right click > View code > Insert > Module.

Step 2

Then copy the below code into the text box, similar to the below image.

Code

Sub Auto_Close()
   ThisWorkbook.Saved = True
End Sub

Step 3

Then save the sheet as a macro−enabled template and click F5 to complete the task.

Note−

If you want to save the changes while closing, use the blow code.

Code

Sub Auto_Close()
   If ThisWorkbook.Saved = False Then
      ThisWorkbook.Save
   End If
End Sub

This code will not work if the workbook is not saved.

Conclusion

In this tutorial, we have used a simple example to demonstrate how you can disable the save prompt when closing a workbook in Excel to highlight a particular set of data.

Updated on: 11-Jul-2023

238 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements