+ Reply to Thread
Results 1 to 7 of 7

Automatically Save External CSV-file

  1. #1
    Registered User
    Join Date
    09-24-2014
    Location
    Norway
    MS-Off Ver
    2007
    Posts
    4

    Automatically Save External CSV-file

    Hi,

    I am using Excel 2007 on Windows 7.
    I am trying to export data from a sheet in workbook to a separate csv-file on a predetermined location. However, I cannot seem to get the Macro to Auto-save the created file.
    I have tried "DisplayAlerts = False" an "ThisWorkbook.Save". However they do not really match my criteria, since I am trying to auto-save an external file.

    The code below creates a CSV an then writes the information to that file.

    Here is the code I am working with: (source: http://www.mrexcel.com/forum/excel-q...orted-csv.html)
    Please Login or Register  to view this content.
    When running this, a get prompted to save the file manually. This is what I want to get rid of.

    is there anyone out there with an idea of how to solve this?

    Thank you!

    Regards
    Trf

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Automatically Save External CSV-file

    FileName = Application.GetSaveAsFilename("test", "CSV/text files (*.csv;*.txt),*.csv;*.txt", 1, "Save As CSV file")

    this is the prompt is this what you want rid of?
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    09-24-2014
    Location
    Norway
    MS-Off Ver
    2007
    Posts
    4

    Re: Automatically Save External CSV-file

    Hi nathansav,
    Yes, I would like to get around that prompt and make it auto-save the CSV to a specific location.

    Regards

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Automatically Save External CSV-file

    Just set it then, so filename="c:\thisishowto\setfilename.csv"

  5. #5
    Registered User
    Join Date
    09-24-2014
    Location
    Norway
    MS-Off Ver
    2007
    Posts
    4

    Re: Automatically Save External CSV-file

    Worked perfectly! Thank you. I'm new to this.
    Much appreciated.

    Regards

  6. #6
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Automatically Save External CSV-file

    Why not just save as CSV or TXT?

  7. #7
    Registered User
    Join Date
    09-24-2014
    Location
    Norway
    MS-Off Ver
    2007
    Posts
    4

    Re: Automatically Save External CSV-file

    I need to be able to export multiple .DAT files (csv file is converted) from one an the same excel file.

    Regards

+ 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. Replies: 1
    Last Post: 10-25-2013, 12:49 AM
  2. 'Automatically' Save a WorkSHEET CSV file on SAVE
    By jacalakie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-21-2013, 08:00 PM
  3. [SOLVED] Is it possible to save data entered in a userform to an external (unopened) excel file?
    By mrapes in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 06-11-2012, 06:46 PM
  4. Save small 15x42 pixel two tone image in macro to avoid external file
    By NumberOCD in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-14-2011, 11:03 AM
  5. Replies: 0
    Last Post: 05-31-2006, 04:10 AM

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