Results 1 to 5 of 5

[SOLVED] Save Filename as Date

Threaded View

Krayvok [SOLVED] Save Filename as Date 06-16-2015, 04:48 AM
Kamboj Re: Save Filename as Date 06-16-2015, 08:38 AM
Kamboj Re: Save Filename as Date 06-16-2015, 08:40 AM
Krayvok Re: Save Filename as Date 06-16-2015, 06:19 PM
Kamboj Re: [SOLVED] Save Filename as... 06-17-2015, 02:49 AM
  1. #1
    Registered User
    Join Date
    06-12-2015
    Location
    WA
    MS-Off Ver
    10
    Posts
    33

    [SOLVED] Save Filename as Date

        'Check Date Formatting To Ensure No Errors
                Range("B2").Select
                    Selection.NumberFormat = "[$-409]mmmm d yyyy;@"
        'Spit File
            Dim GetTitle As String
            Dim DateTheInvoice As String
    
            GetTitle = Range("A1").Value
            DateTheInvoice = Range("B2").Value
                    ActiveWorkbook.SaveAs FileName:= _
                        "C:\SaveToLocationDesired" & GetTitle & "" & DateTheInvoice & ".xlsm", FileFormat:= _
                    xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
                    Application.Close
    
    End Sub
    Trying to get it to save as a A1 Cell, and Cell B2 Which is the date of the invoice.

    So it would export for example as "Invoice-6 1 2015"

    I keep getting Runtime Error 1004
    Cannot Access the File

    Filename or path does not exist
    Used in another program
    File has same name as another.


    Works perfectly fine if I change the cell to a non date cell.
    Last edited by Krayvok; 06-16-2015 at 06:19 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Save as workbook with date and time in filename
    By Undeveloped in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-13-2013, 05:08 PM
  2. [SOLVED] macro to add system date to filename during save
    By paintballlovr in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-12-2013, 02:37 PM
  3. [SOLVED] Save Filename With Date In It
    By timbo1957 in forum Excel Programming / VBA / Macros
    Replies: 28
    Last Post: 05-20-2011, 08:08 AM
  4. Save xls with date appended to end of filename
    By mattmac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-29-2008, 06:41 AM
  5. Date + Filename using save copy as
    By SKelley in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-27-2005, 05:06 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