Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6369381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:47:51+00:00 2026-05-25T00:47:51+00:00

I have some VBA code that saves the spreadsheet under a given filename. Whenever

  • 0

I have some VBA code that saves the spreadsheet under a given filename. Whenever I save it, I get a warning message about “significant loss of functionality”, because there’s data validation in the sheet (although the validation still works after I’ve saved the sheet).

I want to suppress this warning, but I don’t think I should use

Application.DisplayAlerts=false
mySheet.saveAs myFilename
Application.DisplayAlerts=true

because I don’t want to override the warning that tells the user a file with this name already exists, as I want to protect users from accidentally saving over files). How can I specify that I just want to override the “loss of functionality” warning?

EDIT: I saw an answer to a similar question that recommended saving the workbook in a different format. That won’t work here because I’m developing in Excel 2007 but trying to accommodate users who have Excel 2003.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:47:52+00:00Added an answer on May 25, 2026 at 12:47 am

    You can catch the save event and then prompt the user for information. Here’s a quick, untested example I threw together for you:

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    
        Dim iAnswer As Integer
        Dim wkb As Workbook
        Dim oSaveAs As FileDialog
    
        Set wkb = ActiveWorkbook
        Application.DisplayAlerts = False
        If gbUserGenerated Then
            iAnswer = MsgBox("Would you like to save over previous workbook?" _
                             , vbYesNo, "Workbook Already Exists")
            If iAnswer = 6 Then
                wkb.Save
            Else
                Set oSaveAs = Application.FileDialog(msoFileDialogSaveAs)
                oSaveAs.Show
            End If
        Else
            Set oSaveAs = Application.FileDialog(msoFileDialogSaveAs)
            oSaveAs.Show
        End If
        Application.DisplayAlerts = true
    
    
    End Sub
    

    gbUserGenerated would just be a global variable (boolean) that tells you if you created the workbook or if it was the user (if the user always creates the workbook then you wouldn’t really need it).

    Put the code in the Microsoft Excel Object folder in the VBE, put it in the “This Workbook” Module.

    To learn more about events go here:
    http://www.cpearson.com/excel/Events.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some VBA code that needs to talk to a running c# application.
I have some VBA code that opens a webpage, then calls a javascript function
i have some vba code that i need to convert to c# Select Case
I currently have some VBA code that runs through and modifies all my calendar
I have some VBA code that looks like this and the aim is to
Hidden worksheets/workbooks have some limitations to what can be done in VBA code, like
I have created a report in MS Access report and write some VBA code
I have writen some code in VBA (Excel) with error handling labels. It worked
I have a VBA script that inserts long strings into Excel cells. In some
I have some code that autofilters a worksheet based on either the first criteria,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.