Prevent Save as Version Message

  • I have an extensive application which I wrote using Excel 2002 (XP - Version 10). However it will likely be used on anything ranging from 2003 - 1997. When I tested it using Excel 97 it gave me the traditional [annoying] message asking if I was sure I wanted to save it under an earlier version than which it was created.


    I want to get rid of this message (a lot of my users aren't the most computer literate and the more annoying messages I can avoid the better!)
    I tried using:

    Code
    Application.DisplayAlerts = False

    but it doesn't affect this particular message. I need to know how to keep this message from popping up. Please Help.


    P.S. Under 97 (NOT on my 2002) it also gives a "Do you want to save the changes" message upon closing even though the "DisplayAlerts" is set to false. I'm not sure why this is still coming up. Any help would be greatly appreciated. Thanks.

    [COLOR="Red"][SIZE="3"]Semper Fi[/SIZE][/COLOR] :rambo:


    [SIZE="1"]Why programmers get Holloween and Christmas mixed up: OCT31 = DEC25[/SIZE]

  • Re: Saving Under Earlier Version


    You should develop on the earliest version it will be used on.


    Why not let the user decide? If not, use the Before Save Event to capture the save and force the version on them.

  • Re: Saving Under Earlier Version


    Quote from Dave Hawley

    ...capture the save and force the version on them


    I'm not sure I'm following what you mean here. Could you please explain a bit more. Thanks.

    [COLOR="Red"][SIZE="3"]Semper Fi[/SIZE][/COLOR] :rambo:


    [SIZE="1"]Why programmers get Holloween and Christmas mixed up: OCT31 = DEC25[/SIZE]

  • Re: Prevent Save as Version Message


    Like Dave said...use force the save into an earlier version (or whatever you like)...


    Code
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
        ActiveWorkbook.SaveAs Filename:="P:\Excel-Files\Book1.xls", FileFormat:= _
            xlExcel5, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
            , CreateBackup:=False
    End Sub


    You can actually record this process with the macro recorder...however...you would probably need to do some adjusting with the file path and name to suit your needs...such as keeping the same file name and path.

  • Re: Prevent Save as Version Message


    I have something similar but it still comes up with the message. Is the key in the:

    Code
    FileFormat:=xlExcel5


    Which versions do the FileFormat numbers (2-5) correspond to?

    [COLOR="Red"][SIZE="3"]Semper Fi[/SIZE][/COLOR] :rambo:


    [SIZE="1"]Why programmers get Holloween and Christmas mixed up: OCT31 = DEC25[/SIZE]

  • Re: Prevent Save as Version Message


    did you modify the code to suit that I posted above is the first question.


    And yes...the file format should adjust to the version (I think). Like I said, if you play around with the "recorder", it should give you the proper script that you need for this type of process (again assuming you modify the file save location to suit)
    a few versions

    Code
    FileFormat:= xlExcel9795 ' Microsoft Excel 97
    FileFormat:= xlExcel5 ' Mircosoft Excel 95


    HTH

  • Re: Prevent Save as Version Message


    gmccreedy,
    When I record the macro, all it puts for the FileFormat parameter is: "xlNormal" which doesn't really help me a whole lot. Is there a list somewhere of the various save formats?


    Also, why does "Application.DisplayAlerts = False" not affect it?

    [COLOR="Red"][SIZE="3"]Semper Fi[/SIZE][/COLOR] :rambo:


    [SIZE="1"]Why programmers get Holloween and Christmas mixed up: OCT31 = DEC25[/SIZE]

  • Re: Prevent Save as Version Message


    NathanC, you will get xlNormal when you record a macro saving as normal. What else would you expect? Record SaveAs saving as the needed version.


    Also, if you put FileFormat into the VBA help you will get a list. I suggest you drop your Assumed Experience as it's not at the level you assume.

  • Re: Prevent Save as Version Message


    Quote from Dave Hawley

    you will get xlNormal when you record a macro saving as normal. What else would you expect? Record SaveAs saving as the needed version.


    Yes, there are aspects which I don't know. I never claimed to know everything.


    Quote from Dave Hawley

    Also, if you put FileFormat into the VBA help you will get a list.


    The VBA help files are not installed on my personal computer - so I have no way of knowing this.


    Quote from Dave Hawley

    I suggest you drop your Assumed Experience as it's not at the level you assume.


    And I suggest you use some Interpersonal Skills and learn a little TACT. I have developed over 5,000 line applications for several different businesses and have a degree in Computer Science, working towards a Master's. For the most part, I generally know what I'm talking about.


    Sorry if this comes across rude, but in this and another one of my posts recently you have responded offensively.

    [COLOR="Red"][SIZE="3"]Semper Fi[/SIZE][/COLOR] :rambo:


    [SIZE="1"]Why programmers get Holloween and Christmas mixed up: OCT31 = DEC25[/SIZE]

  • Re: Prevent Save as Version Message


    NathanC, so you consider yourself to Know VBA & All of Excel and in the same breath you admit to not knowing how to record a macro save a Workbook as a different version. Come on, you cannot have it both ways.


    I didn't believe my post was rude at all. My suggestion of dropping your Assumed Experience is for your benefit only, nobody else. When those that help see you Know VBA & All of Excel they will naturally be short on details in their replies.


    Quote

    Sorry if this comes across rude, but in this and another one of my posts recently you have responded offensively.

    I take you refer to my post about you not adhering the rules you agreed to and are shown again when posting a new thread? Again, it was blunt but not offensive. You should take note that the big red text on the new thread page states your post will be deleted if no-compliant. I shall take that route next time so you are not offended by my words.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!