Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Las Vegas, Nevada, USA
    Posts
    334
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Say 'Yes' for me (Excel 2003 SP2)

    Running the following code leaves the user to reply to the dialog box " A file named goremail_DOR.xls already exists . . . yada yada yada. Replace It?".
    What code can I add to answer "Yes" automatically?

    ActiveWorkbook.SaveAs Filename:="goremail_DOR.xls", FileFormat:= _
    xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
    , CreateBackup:=False

    ActiveWorkbook.Close

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Say 'Yes' for me (Excel 2003 SP2)

    <code>
    Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs Filename:="goremail_DOR.xls", FileFormat:= _
    xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
    , CreateBackup:=False
    Application.DisplayAlerts = True
    </code>
    Legare Coleman

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Las Vegas, Nevada, USA
    Posts
    334
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Re: Say 'Yes' for me (Excel 2003 SP2)

    Thanks Legare. Just what I needed.

Posting Permissions

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