How to Disable the Save As Prompt in Excel

This post will show you how to use a VBA Macro to save an Excel file and overwrite any existing file without a prompt so that you are going to get the little window that says file already exists do you want to overwrite it. If there is a way that disabling Save prompt when you close your current workbook in Excel. of course yes, the below steps will guide you two VBA codes to disable the save as prompt.

Disable Save Prompt with VBA Code

If you want to disable save prompt without saving changes directly, and you can do the following steps:

Step 1: Enter Microsoft Visual Basic for Applications window via Developer->Visual Basic. You can also press Alt + F11 keys simultaneously to open it.

How to Remove All Extra Spaces and Keep Only One Between Words 5

Step 2: In Microsoft Visual Basic for Applications window, click Insert->Module, enter below code in Module1:

Sub save_close()
    ThisWorkbook.Saved = True
End Sub

disable save as prompt1

Step 3: Save VBA macro, see screenshot below. And then quit Microsoft Visual Basic for Applications.

If you want to disable save prompt with saving changes when closing window or workbook, and you can refer to the above steps, but instead of the below VBA codes.

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

If you want to save it as another file and you can use the below VBA Macro:

Sub saveas_close()
    ThisWorkbook.SaveAs "c:\", 51
End Sub

 

Related Posts

Find and Replace Multiple Values

This post will guide you how to find and replace multiple values at once with VBA macro or using formula  in Excel. How do I make multiple find and replace in Excel. Suppose that you have a few cells containing ...

VBA Macro For VLOOKUP From Another Sheet

In the previous post, you should know that how to fix or remove the #N/A error when using VLOOKUP formula to lookup value from another sheet. And this post will show you how to use VBA code to vlookup data ...

How To Insert Comments in Protected Worksheet in Excel

This post will show you how to allow comments in a protected worksheet in Excel. You can easily to insert comments into cells in a normal worksheet in Excel, but if want to insert a comment in a worksheet that ...

How To Convert Text to Upper Cases(Using VBA) in Excel

This post will show you how to switch from lower case to upper case in Excel. and I am going to show you two different ways of converting text to upper cases using formula or VBA macro in Excel 2013,Excel ...

How To Hide Every Other Row in Excel (Using VBA)

This post will show you how to hide alternate rows or columns in Excel or how to hide every third, fourth, fifth row or column in Excel. If you want to hide every other row in your current worksheet, how ...

Sidebar