Results 1 to 14 of 14

Code to save file

Threaded View

  1. #1
    Registered User
    Join Date
    11-14-2007
    Posts
    11

    Code to save file

    Hello, I am new to this forum and need some help.

    I have this code to save a worksheet into a specific directory:

    Sub Save_Click()
    Filename = "\\S\folder\sub\cases\" & Range("B9") & " " & Range("b7")
    ActiveWorkbook.SaveAs Filename:=Filename
    End Sub
    Cells B9 and B7 give the name to the file.

    If the file already exists, I get a warning. If I click YES, it will overwrite the file, if I click NO, it will give me a run time error 1004.

    What I am looking for is a code that closed the warning when clicking on NO and does not give me the run time error.

    Thank you.
    Last edited by VBA Noob; 11-14-2007 at 02:42 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1