+ Reply to Thread
Results 1 to 2 of 2

Saving Excel file as CSV with current date on MAC

Hybrid View

  1. #1
    Registered User
    Join Date
    04-16-2022
    Location
    uk
    MS-Off Ver
    Office 2019 for Mac
    Posts
    22

    Question Saving Excel file as CSV with current date on MAC

    I am trying to save an Excel file as CSV to a specific path, it has to have a specific file name and the current date.

    If I run this code:

    ActiveWorkbook.SaveAs FileName:= _
    "/Users/Username/Desktop/UploadFiles/Outbound 15.04.2022_.csv" _
    , FileFormat:=xlCSV, CreateBackup:=False

    That works , but I need the date to be generated every day anew, so I tried this:

    ActiveWorkbook.SaveAs FileName:= _
    "/Users/Username/Desktop/UploadFiles/" & "Outbound " & Format(Date, "dd-mm-yyyy") & ".CSV"_
    , FileFormat:=xlCSV, CreateBackup:=False

    But this returns Compile error:syntax error.

    What am I doing wrong here?

    Another weird thing is, if I paste the above code, this >>>••••ˇˇˇˇ is appended after the last "false" statement, but I cannot see it in the VBA editor.

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,253

    Re: Saving Excel file as CSV with current date on MAC

    Missing space before newline transfer character
    (...) & ".CSV " _
    (...)
    Artik

+ 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. Saving a copy of Excel file daily with current date - How to?
    By filipana in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 10-18-2017, 01:28 AM
  2. [SOLVED] Saving MASTER file, automatically remove part of file name and append current date?
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-10-2014, 08:13 AM
  3. Replies: 0
    Last Post: 05-17-2014, 04:21 PM
  4. Saving file to its current location and current file name with current date and "FINAL"
    By ironwill20 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2012, 03:22 AM
  5. [SOLVED] Saving temporary text file to particular location with the name of current Date and Time
    By muralidaran in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-06-2012, 10:46 AM
  6. adding current date then after saving the file current date function stops
    By gotbitey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2011, 02:15 PM
  7. Auto Saving File to Folder with Current Date
    By mengghee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2008, 05:50 PM

Tags for this Thread

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