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. #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
  •