Results 1 to 2 of 2
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Excel distinguish between save & saveas (Excel XP)

    How can I distinguish between the user choosing "save" as distinct from "saveAS"?

    I've cobbled together the attached XLS, which i save as an XLA. It fires up well when I choose Save or saveAs, and the line<pre>MsgBox "Application Event: WorkbookBeforeSave: " & Wb.Name</pre>

    makes itself known.

    I have simple logic, and know how to test for not-previously-saved, which I am to treat as a save-with-new-name.
    If the user tries to save a previously-saved file, I'm supposed to know that, and effect a silent .Save.
    But if the user issues a saveAs, I'm to do srange and wonderful things with the filename, before effecting a .SaveAs.

    A WorkbookBeforeSaveAs would suite me fine.

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel distinguish between save & saveas (Excel

    OK. Thanks for listening.
    The answer was staring me in the face. a.k.a. RTFParameterList, dummy.

    <pre>Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal SaveAsUI As Boolean, Cancel As Boolean)
    If SaveAsUI Then
    MsgBox "saveAS"
    Else
    MsgBox "save"
    End If
    End Sub
    </pre>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •