+ Reply to Thread
Results 1 to 7 of 7

i have this bit of code that saves a file, how to default it to a folder

  1. #1
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    i have this bit of code that saves a file, how to default it to a folder

    here is my code that works:

    Please Login or Register  to view this content.
    now how can i pre-set the folder for this save?

    can anyone help me with this?
    Last edited by dmcgov; 05-11-2016 at 02:58 PM. Reason: typo

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: i have this bit of code that saves a file, how to default it to a folder

    That code doesn't save a file, it opens a dialog to allow the user to enter a filename and location for the file to be saved.

    If you want the dialog to open in a specific folder specify it with the InitialFileName argument.

    For example, this will open the dialog in the folder Test on the C:\ drive.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: i have this bit of code that saves a file, how to default it to a folder

    many thanks for that. sorry it took me awhile to give you a gold star.

  4. #4
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: i have this bit of code that saves a file, how to default it to a folder

    so it took me a bit to realize that this routine is not saving the CSV file. Is there something wrong with this code?

    Please Login or Register  to view this content.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: i have this bit of code that saves a file, how to default it to a folder

    Like I said that code does not save a file, it just gets the filename and destination fom the user.

    You'll need further code to actually do the saving.

    What exactly are you trying to save?

  6. #6
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: i have this bit of code that saves a file, how to default it to a folder

    im trying to save the Import tab as a CSV file.

    can you help?

  7. #7
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: i have this bit of code that saves a file, how to default it to a folder

    Quote Originally Posted by dmcgov View Post
    so it took me a bit to realize that this routine is not saving the CSV file. Is there something wrong with this code?

    Please Login or Register  to view this content.
    so just need to add this one line to make it work
    Please Login or Register  to view this content.

+ 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: 2
    Last Post: 12-29-2015, 04:19 AM
  2. Save Button that looks up latest file in folder, adds one and saves
    By Kucster in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-14-2014, 11:55 AM
  3. [SOLVED] Save As Dialog Box - Default Path and File Name, User Selects Sub Folder from Default Path
    By christenprochaska in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2012, 05:17 PM
  4. [SOLVED] Run a Macro every 7 days that saves the file in a different folder
    By Djflare in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-03-2012, 03:33 PM
  5. Code to print all files in a folder (to default printer)
    By jwhitwell in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-22-2010, 04:35 PM
  6. Selecting Default Folder in Open File Dialogue Box Problem
    By PaulC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2010, 04:25 PM
  7. [SOLVED] Need code to save file to new folder, erase from old folder
    By Ron M. in forum Excel General
    Replies: 1
    Last Post: 02-24-2006, 02:10 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