+ Reply to Thread
Results 1 to 3 of 3

Save File Command Button

  1. #1
    Registered User
    Join Date
    09-17-2011
    Location
    Alberta
    MS-Off Ver
    Excel 2010
    Posts
    63

    Save File Command Button

    Want to save file name in excel 2013 from what is cell f9
    I'm getting an error on this line

    ActiveWorkbook.SaveAs FileName:=Path & FileName1 & ".xls", FileFormat:=xlNormal

    Here is my code

    Private Sub CommandButton1_Click()
    Dim Path As String
    Dim FileName1 As String
    Path = "C:\Progress Calibrations\"
    FileName1 = Range("f9")
    ActiveWorkbook.SaveAs FileName:=Path & FileName1 & ".xls", FileFormat:=xlNormal
    End Sub

    Thanks For any help

  2. #2
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Save File Command Button

    Your code should work unless you have illegal characters (for naming files) in cell F9
    Any of these present:
    / : * ? < > , | "

    I assume the folder exists!

    What is the error message?

    Is there some reason that you want an XLS rather than XLSX? You are using Office 2010 according to profile.

    Please Login or Register  to view this content.
    should also work
    Last edited by Kevin#; 05-22-2016 at 03:15 AM.
    If a response has helped then please consider rating it by clicking on *Add Reputation below the post
    When your issue has been resolved don't forget to mark the thread SOLVED (click Thread Tools at top of thread)

  3. #3
    Registered User
    Join Date
    09-17-2011
    Location
    Alberta
    MS-Off Ver
    Excel 2010
    Posts
    63

    Re: Save File Command Button

    Thanks, shoul dof known better

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Using Command Button to Save File
    By excelneub in forum Excel General
    Replies: 0
    Last Post: 08-27-2014, 12:58 PM
  2. Add a new folder with Save File Button command VBA
    By RichardJSigKits in forum Excel General
    Replies: 4
    Last Post: 05-06-2014, 10:43 AM
  3. Command Button to "Save As". Setting Cell value as file name
    By seanturner9005 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2013, 12:20 PM
  4. [SOLVED] 'Save' or 'save as' Command Button VBA Excel
    By eemiller1997 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-07-2013, 04:09 PM
  5. Export to pdf command button save as file name question
    By Miamited in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-14-2012, 02:33 PM
  6. [SOLVED] Save as new file command button
    By EnGo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-28-2006, 10:00 AM
  7. [SOLVED] set up a command button or macro for open file to "save as"
    By Mo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-22-2005, 07:19 PM

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